I have a list of short wav files. Two of these files cannot be played either on the simulator or on the device itself. All wav files lasting 1 second.
This is how I play files
SystemSoundID soundID;
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"sound1" ofType:@"wav"];
NSURL *fileUrl = [NSURL fileURLWithPath:filePath];
AudioServicesCreateSystemSoundID((CFURLRef)fileUrl, &soundID);
AudioServicesPlaySystemSound(soundID);
Can someone please tell me what the problem is. Thank.
PS When I browse files in Finder, files that cannot be played show the default player as QuickTime, and the rest show the default player as iTunes, if that helps anyway.
The solution suggested by Alan is to use AIFF files. To convert wav to AIFF, open the sound file in iTunes. In iTunes, select "Settings" - "General" - "Import Settings β Import" using AIFF Encoder. Select a sound file, and in the "Advanced" menu, select the option "Create AIFF version"
source
share