avaudioplayer

How to show Time Remaining when playing a song in my iPhone app?

I use AVAudioPlayer to play an mp3 file to a user within my iPhone app. This all works fine and dandy. I even update a PLAY/PAUSED button depending on the state of the player. But it would be nice to know how much longer the song will play. So How do I show the time remaining? ...

How do you control the playback levels (decibles?) using the iPhone AVAudioPlayer? Or do I need to use a different API?

My audio clips sound perfect when I upload them to the iPhone via iTunes. And I am pretty sure it is because the iPod has a maximum playback level, so the audio doesn't sound overdriven. In my app, I include the same audio files, and when I play them [myAudio play]; the levels are so high that the audio becomes indiscernible. I foun...

Playing video and audio in iPhone not working...

So we have buttons linked up to display images/videos/audio on click depending on a check we do earlier. That part works fine. It knows which one to play, however, when we click the buttons for video and audio, nothing happens. The image one works fine. The video and audio are being taken for a URL online, they are not local, but everyw...

Stream video with MPMoviePlayer while streaming separate audio file in background, all from remote URL

So we want to be able to stream a video from a website. We also want to be able to do the same with a separate audio file. The reason why we need them to stream separately and can't integrate the two into just a video is because we need the user to be able to scrub the video however the audio should keep playing. Is there a way to get ...

AVAudioPlayer not looping

Hey guys, I have this code: - (id<SelfReleasingSound>) initWithFilepath: (NSString *) filepath { self = [super init]; if(self != nil){ NSData * soundFileData = [NSData dataWithContentsOfFile: filepath]; NSError * error; player = [[AVAudioPlayer alloc] initWithData: soundFileData error: &error]; if(error != nil){ ...

How do I force one method to be executed before another method?

I've got 2 methods. One method starts playing an audio file (.mp3), the other method updates a UIToolBar to show a button (PLAY or PAUSE). These two methods are called in the following order: //Adds some UIBarButtonItems to a UIToolBar [self togglePlayer]; //Uses AVAudioPlayer [audioPlayer play]; TogglePlayer does this: -(void)toggle...

Generating an LPCM buffer in memory for AVAudioPlayer initWithData

I want to generate a sound wave programmatically and play it with AVAudioPlayer. I have the code to encode my waveform as linear PCM, 44100Hz, mono, 8 bits per sample. I am not clear on what kind of envelope I need to wrap around this buffer so that AVAudioPlayer recognizes it as PCM. ...

Delay in playing sounds using AVAudioPlayer

-(IBAction)playSound{ AVAudioPlayer *myExampleSound; NSString *myExamplePath = [[NSBundle mainBundle] pathForResource:@"myaudiofile" ofType:@"caf"]; myExampleSound =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:myExamplePath] error:NULL]; myExampleSound.delegate = self; [myExampleSound play]; } I want to play...

How can I play a music such that it automatically replay it after its end?

AVAudioPlayer *myExampleSound; NSString *myExamplePath = [[NSBundle mainBundle] pathForResource:@"myaudiofile" ofType:@"caf"]; myExampleSound =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:myExamplePath] error:NULL]; myExampleSound.delegate = self; [myExampleSound play]; How can I play myExampleSound such that...

iPhone - Preventing Sleep while using applicationMusicPlayer in MPMusicPlayerController

I am trying to disable the automated sleeping of iPhone for certain period in my app. Used [[UIApplication sharedApplication] setIdleTimerDisabled:YES] which works fine as long as I play no music. But when I play music the Idle Timer seems to get reactivated. I have tried all kinds of tricks from NSTimer firing silent sounds every 10 ...

Conflit between AVAudioRecorder and AVAudioPlayer

Hi, here is my problem : The code (FooController) : NSString *path = [[NSBundle mainBundle] pathForResource:@"mySound" ofType:@"m4v"]; soundEffect = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL]; [soundEffect play]; // MicBlow micBlow = [[MicBlowController alloc]init]; And MicB...

Play multiple audio files using AVAudioPlayer

Hi all, I am planning on releasing 10 of my song recordings for free but bundled in an iphone app. They are not available on web or itunes or anywhere as of now. I am new to iphone sdk (latest) as you can imagine, so I have been going through the developer documentation, various forums and stackoverflow to learn. Apple's avTouch sample...

how to use single instance of AVAudioPlayer for playing multiple songs?

I want to play multiple songs with single object of AVAudioplayer, I put songs in table row , when user tap on row player view is open but when user go back in other row in table player play both songs simanteniosly . what I Can do to fix this? ...

AVAudioPlayer slow buffering over HTTP

Hi! When Im using AvAudioPlayer (Iphone) for streaming music from http it takes about 7 seconds until it starts playing. If Im using AudioQueue (about 8 buffers) instead the number of seconds is about 3 for the same song. Is this because AvAudioPlayer is using a larger buffer internally? Is there any way of speeding up AvAudioPlayer? ...

AVAudioPlayer only initializes with some files

Hi everyone, I'm having trouble playing some files with AVAudioPlayer. When I try to play a certain m4a, it works fine. It also works with an mp3 that I try. However it fails on one particular mp3 every time (15 Step, by Radiohead), regardless of the order in which I try to play them. The audio just does not play, though the view loadin...

How to find the leaky faucet that loads into Malloc 32kb

I have been messing around with Leaks trying to find which function is not being deallocated (I am still new to this) and could really use some experienced insight. I have this bit of code that seems to be the culprit. Every time I press the button that calls this code, 32kb of memory is additionally allocated to memory and when the bu...

Play a sound based on the button pressed on the IPhone/xcode.

I'm trying to play a sound based on which button is pressed using AVAudioPlayer. (This is not a soundboard or fart app.) I have linked all buttons using this code in the header file: @interface appViewController : UIViewController <AVAudioPlayerDelegate> { AVAudioPlayer *player; UIButton *C4; UIButton *Bb4; UIButton *B4; UIButton *A...

Play stereo sound as mono sound for different channel using c#.net

hi I want to play a stereo sound in the following manner using c#.net It’s a stereo track: Make it possible to hear only the L or only the R channel or both channels simultaneously. If you play only on channel put the audio out in mono so that you can hear the one channel in either speakers or headphones Thanks in advance for any hel...

UISlider to control AVAudioPlayer

hi everyone, I'm trying to implement a little function in my app. I am currently playing sounds as AVAudioPlayers and that works fine. What I would like to add is to control the sound's position (currentTime) with an UISlider: is there a simple way to do it ? I looked at an Apple project but it was quite messy....have you got samples o...

AVAudioPlayer via Speakers

I got the following code: - (id)init { if (self = [super init]) { UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback; AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(sessionCategory), &sessionCategory); UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker; ...