I have found the media.playSound function, but I do have a question about one thing.
I am using the voice recording and currently have the below code
media.playSound( “playerSound.aif”, system.DocumentsDirectory )
“playerSound.aif” is the file that saves what the player records and I have gotten this to work perfectly
I was reading the documentation, I see that it has the ability to add an on complete function, but I can seem to figure out how the code should go.
media.playSound( soundfile [, baseDir] [, onComplete] )
Im not quite sure what the [] are for or how to use them. As you can see in my above code, I am able to define the base directory without using the brackets, yet when I try to edit my code to the following
media.playSound( “playerSound.aif”, system.DocumentsDirectory, onComplete = calledFunction )
It does not seem to work, if I try and add in the brackets, to something like this
media.playSound( “playerSound.aif” [, system.DocumentsDirectory] [, onComplete = calledFunction] )
I end up getting and error saying that “]” is expected.
Any tips on how im supposed to include the onComplete portion and how I am supposed to format it.