avaudioplayer

Developing SDK 3.1.2 compatible audio.caf Files

Apparently SDK 3.1.2 has a built in discrimination about certain audio.caf files being passed to AVAudioplayer. Some files that worked fine with SDK 3.0.1 get a returned content null from AVAudioplayer using exact same code on simulator or iphone with SDK 3.1.2. All files are 16-bit Integer, Big Endian, Mono, 22.050 KHz, Data rate 352....

iPhone - why does AVAudioPlayer currentTime return a negative value?

Hi When does the AVAudioPlayer's currentTime method return a negative value? The audio file is playing (I am putting in a check before getting currentTime) but making a call to currentTime returns a negative value. Any ideas? Thanks if(thePlayer != nil && [thePlayer isPlaying]){ double playerTime = [thePlayer currentTime]; NSL...

sound and Nstimer stopped when iphone is in deepsleepmode?

I am creating an application in which I'm using nstimer and avaudioplayer to play sound,but both sound and timer stops when phone is in deep sleep mode.how to solve this issue? here is the code to play audio -(void)PlayTickTickSound:(NSString*)SoundFileName { //Get the filename of the sound file: NSString *path = [NSString stringWithFo...

Supported Audio file formats in iPhone

Hi, What are the supported audio files formats in iPhone? If I want to play a 2 hour audio files , what is the best audio file format I should have in my App? Thanks ...

AVAudioPlayer - Metering - Want to build a waveform (graph)

Hey guys! I need to build a visual graph that represents voice levels (dB) in a recorded file. I tried to do it this way: NSError *error = nil; AVAudioPlayer *meterPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:self.recording.fileName] error: if (error) { _lcl_logger(lcl_cEditRecording, lcl_vError, ...

Start .mp3 play half way through with AVAudioPlayer

Ok, this isn't an easy question (at least not yet). I've got AVAudioPlayer working beautifully: I download an mp3 with NSURLConnection then play that data with AVAudioPlayer. My question is how could I start AVAudioPlayer playing at an arbitrary point in the mp3? I can start downloading at an arbitrary point by setting HTTP headers, no...

Help stopping audio using AVAudioPlayer

Alright I have two problems. I'm using AVAudioPlayer to play a simple audio file in .caf format. What I'm trying to do is have a play and pause button. Here is a sample of a simple IBAction to play the audio from a button. - (IBAction) clear { NSString *path = [[NSBundle mainBundle] pathForResource:@"clear" ofType:@"caf"]; AVAudioPla...

AVAudioPlayer error for Iphone Development

Hello , I am developing an iphone application using "AVAudioPlayer" for playing a ".wav" file . For this i am adding header file "#import <AVFoundation/AVAudioPlayer.h>" . But while compiling i am getting error like : ".objc_class_name_AVAudioPlayer", referenced from: literal-pointer@__OBJC@__cls_refs@AVAudioPlayer in Webv...

fast forwarding a song using AVAudioPlayer

I am creating an audio player application, i need to enable the user to fast forward and backward a song by holding a button(seperately for each). I've done for playing, stopping, skip to next and previous song. But i got stuck with this section. I dont know the method to implement this. pls help. ...

Two action methods for an UIButton; next track and seek forward:

I am creating a music player application and it need that 2 actions to be called from a single button, one to skip to next track by touch up inside event and other to fast forward the curenttrack incase of a 'long press'. I don't know which event is pointing to this long press, i thought it to be touch down, but it worked only while hold...

iPhone, is it possible to play a sound from the speakers while in a call?

I would like to know from some iphone-Audio expert if there is a way to let a sound play through the line in of the microphone, or at least to play from the speaker (not the receiver) during a call. I've tried different combinations of AVAudioSessionCategory with kAudioSessionProperty_OverrideAudioRoute, but I've noticed that when the i...

iPhone AVAudioPlayer loop stuttering?

I have a sound that is about 2 seconds long which I have set it's it's numberOfLoops property to -1, but it has a .5 second lag between loops i want the sound to fade into itself when it is looping. Help please! ...

Strange behaviour with AVAudioPlayer on the iPhone

I'm attempting to play a sound using AVAudioPlayer. Should be simple, but I'm seeing some odd results. Code: NSString *path = [[NSBundle mainBundle] pathForResource:@"pop" ofType:@"wav"]; NSURL *url = [NSURL fileURLWithPath:path]; AVAudioPlayer *sound = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil]; [sound play]; [sound r...

What is the smoothest audio API for looping iPhone sounds

I am trying to loop a 2 second sound continuously that I am using in my touchesMoved method and want to make it play continuosly and not stutter or stop because the user stopped moving their finger and also maybe fade the sound into itself smoothly. I have tried system sounds and AVAudioPlayer ...

Showing duration of a song in uilabel or uitextfield

Hi all, I am developing a music player application. I have picked music files from the ipod library, and is playing them. I'm using AVAudioPlayer for this. What i need now is to show the duration of the song on the top of the view. I got the duration as NSTimeInterval *duration = [musicplayer duration]; But i dont know how to use it t...

How to play the iPod Library file in the AVPlayer..

Hi, I need your help Please tell me how you taken the ipod library music file in the AVAudioPlayer? Thanks, Karthick ...

Unable to Implement Forward Action in AVAudioplayer

Hello, I am using AVAudioplayer to play some audio files. I have some controls like forward and rewind. Rewind is working properly but forward is not. - (void)rewind { AVAudioPlayer *player = _rewTimer.userInfo; player.currentTime-= SKIP_TIME; [_rewTimer invalidate]; _rewTimer=nil; [self updateCurrentTime]; } - (v...

How would I add effects to AVAudioPlayback

I want to add effects to a sound using the AVAudioPlayer framework. Such effects as echo, pitch change, speed, etc. How would I do this. ...

AVAudioPlayer not releasing memory

I initialize an ivar AVAudioPlayer variable, play and the try to release its memory. After the release line, it doesn't set to 0x0. After the nil line it doesn't change to 0x0. Does AVAudioPlayer require something special to release its memory? audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath: [[NSBun...

Sounds randomly interrupted when starting to play

I'm calling playSoundFromBundle from the code below to play sounds (aif files). I have a sound that does a single click and then a fading sound. Both sounds are in the same file. Sometimes I get two clicks and then the fade. Meaning, click, click...fade. A single click isn't what should play. I'm guessing the sound starts (click s...