avaudioplayer

audioPlayerDidFinishPlaying not being called during scrolling UITableView

One of my views is a UITableView which acts as the delegate for an AVAudioPlayer and this table essentially plays sounds when you select a certain row with options to repeat the sound after its finished playing. However, I noticed that if I select a cell with repeat ON for a certain sound and then scroll through the UITableView to sel...

AVAudioPlayer working in Simulator, but not on device

My mp3 playing code is: NSError *error; soundObject = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:audioPathString] error:&error]; if (soundObject == nil) NSLog(@"%@", [error description]); soundObject.delegate = self; soundObject.numberOfLoops = 0; soundObject.volume = 1.0; NSLog(@"about to play"); [soundObject p...

Crashes when using AVAudioPlayer on iPhone

Hi all, I am trying to use AVAudioPlayer to play some sounds in quick succession. When I invoke the sound-playing function less frequently so that the sounds play fully before the function is invoked again, the application runs fine. But if I invoke the function quickly in rapid succession (so that sounds are played while the previous so...

Can I store AVAudioPlayer references in an NSMutableArray and play them at will?

I have a library of 16 short sound clips I need to be able to play in quick succession. I realized that creating and preparing AVAudioPlayer objects in real time was too much to ask of the iPhone. So instead, during my app's initialization, I am pre-creating a series of AVAudioPlayers so that each one is basically pre-loaded with one...

Multi-tasking with AVAudioPlayer

I have an audio app using AVAudioPlayer build for iPhone 3.x, now I would like to harness the multi-tasking capability in iOS 4 such that it can play music at the background. I tried to search for sample code but no luck. Can anyone help showing me how to enable AVAudioPlayer for background playing in iOS 4? thanks. ...

[iPhone] AVAudioPlayer isPlaying always return null

Hey guys, I'm experiencing an odd problem with AVAudioPlayer class. Everytime I try to access one of it's properties they are null. // Get the file path to the song to play. NSString *filePath = [[[NSBundle mainBundle] pathForResource:pSound.fileName ofType:pSound.fileType] retain]; // Convert the file path to a URL....

AVAudioRecorder audioPlayerDidFinishPlaying delegate not working correctly

I have a sound file I play using AVAudioPlayer. Simultaneously I record using AVAudioRecorder, both at 44.1kHz. I prepare the player/recorder, call play/record one right after the other, and have the recorder stop when AVAudioPlayers delegate audioPlayerDidFinishPlaying is called. When I look at the recorded audio file I see the recordi...

OpenAL Vs. AVAudioPlayer/AVAudioRecorder on iPhone

Hi, What is the difference between OpenAL and AVAudioPlayer on the iPhone? It seems that both can be used for playing/recording audio. When would you use either? What advantages/features does each provide? Thanks! -MT ...

Anybody having problems with sound playing on iPhone OS 4.0?

I just installed an app I'm building on my iPhone 4, and even though the sounds I'm using play in the simulator, they don't play on the phone. Just using an AVAudioPlayer object for all the sounds that need to play when a user interacts with the app. ...

Entering background on iOS4 to play audio

The documentation is rather poorly written when talking about playing audio in the background. It gives the impression that all you have to do to continue playing the audio that you are currently playing is to just add a key/value pair to the info.plist file and wallah, it's magic. However, this is not the case. For instance, if I pla...

Flash/flex component Youtube like seekbar

I am developing a audio player in flex. I need a seekbar kind of like on youtube's video player. To implement the basic seek functionality the HSlider component is enough. But I also want to show the stream progress on the seek bar. (youtube colors the already streamed part of the seekbar red). Is there a way I can achieve the same? I a...

Is it possible to test iOS4 multitasking/background music playing on the simulator?

I have added the UIBackgroundModes property in Info.plist to have an array entry of "audio" and have added the call to setup the audio session: [session setCategory: AVAudioSessionCategoryPlayback error: &error];. However, the only test device I have is the iPod Touch 2G which doesn't support multitasking. I've tried the simulator but ...

iPhone, AVAudioPlayer and multiplesounds

Hi to all,im new developer and making my firt iPhone app ,and i want to make button to on/off multiplesounds , example when i press button for multiple sounds after when i play sounds it plays all sound at same time and if its off can play only one sounds, what code is to make ON/OFF multiple sounds play? sorry for my bad english, Tank...

Play and record sound simultaneously with iPhone SDK?

I'm trying to detect input from the mic and also play sounds, which can be toggled on or off, but are always playing when the mic listener is active. I've initialized my AVAudioSession in the viewDidLoad method like so: AVAudioSession *session = [AVAudioSession sharedInstance]; NSError *err = nil; [session setCategory:AVAudioSessionCat...

Volume control using UIslider Iphone??

i am creating a application in which sound is played when a button is pressed and using a UISlider with which volume can be adjusted.Sometimes the volume of sound is too high and sometimes its too low even after increasing the volume of iphone to the full.How can i keep the volume to always high?? any possible way to integrate system vol...

iOS4 - Background audio with iPhone Simulator

I unsuccessfully tried to implement a playback audio that continues to play in background by setting the UIBackgroundModes property and by activating an audio session as Joshua Weinberg suggested, but it doesn't work on the simulator and I have no chance to test on a device with iOS4. I read about of a possible issue with the simulator, ...

handling interuption for multiple AVAudioPlayers

Hello there, Does anybody know if it is possible to handle interruption by AVPLayer delegate when I have more then one AVPlayer? I have tried few things to start again two AVPlayer after phone call, but still only one respond and started, the second one was paused and did nothing. thank you in advance for any idea Vanya ...

Problem Starting and Stopping AVAudioPlayer

I have a class in which I have an audio player. In class B, I have a switch, from where I want to take control of play and stop of background music. I am not able to stop and play music through switch. this is my audio player at viewdidload of class A NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/bgmusic.wav", [...

AVAudioPlayer with MPMusicPlayerController

I have music playing within my application using a MPMusicPlayerController, using iPodMusicPlayer (also tried applicationMusicPlayer). When I play a sound using AVAudioPlayer my music from my MPMusicPlayerController will stop. Is there a way to have the MPMusicPlayerController and the AVAudioPlayer play sounds simultaneously? ...

Using SystemSoundID throughout my app?

Hi all, Can someone please point me in the right direction... I need to use the same sound (a button press) throughout all view controllers in my app. What is the best way to do this. I have managed to load and play a sound in a single view controller but cannot manage to pass a sound to different viewcontrollers because SystemSoundID i...