我将在我的应用程序中使用.wav音频文件。iPhone:AVAudioPlayer是否支持.wav格式?
是否AVAudioPlayer
支持.wav
文件格式?
还有哪些其他格式支持AVAudioPlayer
?
我将在我的应用程序中使用.wav音频文件。iPhone:AVAudioPlayer是否支持.wav格式?
是否AVAudioPlayer
支持.wav
文件格式?
还有哪些其他格式支持AVAudioPlayer
?
是的,AVAudioPlayer
为您提供播放.wav
文件的可能性。
这是很简单的:
// 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];
来源:MultimediaPG
音频播放和录制格式 音频播放格式在iPhone支持:Playing Sounds Easily with the AVAudioPlayer Class
您对您的问题在这里找到完整的答案OS如下:
*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
iPhone OS支持的音频录制格式如下:
*AAC (on supported devices only)
*ALAC (Apple Lossless)
*iLBC (internet Low Bitrate Codec, for speech)
*IMA4 (IMA/ADPCM)
*linear PCM
*µ-law and a-law