MP3 file is not playing in iPhone
I am trying to play audio file in iPhone,but it is not playing properly and throw error "The operation coul开发者_JAVA百科dn't be completed. (OSStatus error -43.) in iphone" and app crash. But this mp3 file is playing in Simulator.
File name's in simulator is case insensitive whereas file names on device is case sensitive. Check your mp3 file name is correct.
Try with below on your Mac OS terminal,you will get the reason for the error.
$ macerror -43
Response
Mac OS error -43 (fnfErr): File not found
Check the file at your given path ....
Here is the good tutorial to know more abt the OSErr
& OSStatus
errors.
http://orangejuiceliberationfront.com/carbon-for-the-cocoa-guy-oserror-and-osstatus/
AudioServicesCreateSystemSoundID doesn't work with MP3 files on the device. If you use that method, try converting it to WAV and let me know if it worked! If not, explain a bit what code you use to play the sound.
When a file works in the simulator and not the device it could be the string case of your file name. iphone devices is case sensitive for file names.
精彩评论