I am going to use .wav audio files in my app.
Does AVAudioPlayer
supports .wav
file format ?
And which other formats supported by AVAudioPlayer
?
Yes, AVAudioPlayer
gives you the possibility to play .wav
files.
It's pretty straight forward:
// in the corresponding .h file:
// @property (nonatomic, retain) AVAudioPlayer *player;
// in the .m file:
@synthesize player; // the player object
NSString *soundFilePath =
[[NSBundle mainBundle] pathForResource: @"sound"
ofType: @"wav"];
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: soundFilePath];
AVAudioPlayer *newPlayer =
[[AVAudioPlayer alloc] initWithContentsOfURL: fileURL
error: nil];
[fileURL release];
self.player = newPlayer;
[newPlayer release];
[player prepareToPlay];
From: Playing Sounds Easily with the AVAudioPlayer Class
You find complete answer on your question here : MultimediaPG
Audio Playback and Recording Formats The audio playback formats supported in iPhone OS are the following:
*AAC
*HE-AAC
*AMR (Adaptive Multi-Rate, a format for speech)
*ALAC (Apple Lossless)
*iLBC (internet Low Bitrate Codec, another format for speech)
*IMA4 (IMA/ADPCM)
*linear PCM (uncompressed)
*µ-law and a-law
*MP3 (MPEG-1 audio layer 3
The audio recording formats supported in iPhone OS are the following:
*AAC (on supported devices only)
*ALAC (Apple Lossless)
*iLBC (internet Low Bitrate Codec, for speech)
*IMA4 (IMA/ADPCM)
*linear PCM
*µ-law and a-law
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With