简体   繁体   中英

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 couldn'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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM