2011-09-12 23 views

Respuesta

3

Sí, AVAudioPlayer le da la posibilidad de reproducir archivos .wav.

Es bastante sencillo:

// 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]; 

Desde: Playing Sounds Easily with the AVAudioPlayer Class

0

a encontrar respuesta completa sobre su pregunta aquí: MultimediaPG

de audio de reproducción y grabación Formatos Los formatos de reproducción de audio en el iPhone OS son los siguientes:

*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 

Los formatos de grabación de audio admitidos en iPhone OS son los siguientes:

*AAC (on supported devices only) 
*ALAC (Apple Lossless) 
*iLBC (internet Low Bitrate Codec, for speech) 
*IMA4 (IMA/ADPCM) 
*linear PCM 
*µ-law and a-law 
Cuestiones relacionadas