Search Results

Search found 122 results on 5 pages for 'avaudioplayer'.

Page 2/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • problem in playing next song in the avaudioplayer

    - by Rajashekar
    Hello friends my delegate method looks like this. after the first song is played it goes into this method and plays the second song , however when the second song is done playing it stops. it does not go into the delegate method.i need to play all the songs continuously. i am not sure, why. can someone help me. (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)p successfully:(BOOL)flag { if (flag == NO) NSLog(@"Playback finished unsuccessfully"); else { //[player stop]; index++; NSLog(@"%d",index); path=[[NSBundle mainBundle] pathForResource:[songlist objectAtIndex:index] ofType:@"mp3"]; [player initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL]; [songlabel2 setTitle:[songlist objectAtIndex:index]]; [endtime setText:[NSString stringWithFormat:@"%.2f",[player duration]/100]]; [player play]; } }

    Read the article

  • Play multiple audio files using AVAudioPlayer

    - by inScript09
    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 application was a great start. But I want my app to play all the 10 tracks one by one. All the songs are added to resources folder and are named as track1, track2...track10. In the avTouch app code I can see the following 2 parts which is where I think I need to make changes to achieve what I am looking for. But I am lost. // Load the array with the sample file NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"m4a"]]; - (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag { if (flag == NO) NSLog(@"Playback finished unsuccessfully"); [player setCurrentTime:0.]; [self updateViewForPlayerState]; } can anyone please help me on 1. how to load the array with all the 10 tracks which are added to resources folder 2. and when I hit play, player should start the first track. when the 1st track ends 2nd track should start and so on for the remaining tracks. Thank You

    Read the article

  • UISlider to control AVAudioPlayer

    - by David Pollak
    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 or suggestions ? Thanks to everyone in advance

    Read the article

  • AVAudioPlayer won't play audio file after AVAudioRecorder

    - by Kevin
    I create a .caf audio file using AVAudioRecorder and if I try and play it back using AVAudioPlay I get no sound on the iPhone (if played in simulator works fine). If I close my application and reopen the file plays fine. Also I am not able to adjust the phone volume after recording unless I close and reopen my application. Any ideas?

    Read the article

  • Second call to AVAudioPlayer -> EXC_BAD_ACCESS (code posted, what did I miss?)

    - by Jordan
    I'm using this code to play a different mp3 files with every call. The first time through works great. The second time crash, as indicated below. .h AVAudioPlayer *player; @property (nonatomic, retain) AVAudioPlayer *player; .m -(void)load:(NSURL *)aFileURL { if (aFileURL) { AVAudioPlayer *newPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL: aFileURL error: nil]; [aFileURL release]; self.player = newPlayer; // CRASHES HERE EXC_BAD_ACCESS with second MP3a [newPlayer release]; [self.player prepareToPlay]; [self.player setDelegate:self]; } } I know I must have missed something, any ideas?

    Read the article

  • iPhone - why does AVAudioPlayer currentTime return a negative value?

    - by lostInTransit
    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]; NSLog(@"Player Time: %f", playerTime); } Output Player Time: -0.019683

    Read the article

  • iOS 5.0 AVAudioPlayer Error loading audio clip: The operation couldn’t be completed. (OSStatus error -50.)

    - by Jason Catudal
    So I'm trying to test out the audio player on the iPhone, and I went off Troy Brant's iOS book. I have the Core Audio, Core Foundation, AudioToolbox, and AVFoundation frameworks added to my project. The error message I get is in the subject field. I read like 20 pages of Google search results before resorting to asking here! /sigh. Thanks if you can help. Here's my code, pretty much verbatim out of his book: NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"Yonah" ofType:@"caf"]; NSLog(@"%@", soundFilePath); NSURL *fileURL = [NSURL URLWithString:soundFilePath]; NSError *error; audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:&error]; if (!error) { audioPlayer.delegate = self; //audioPlayer.numberOfLoops = -1; [audioPlayer play]; } else { NSLog(@"Error loading audio clip: %@", [error localizedDescription]); } EDIT: Holy Shinto. I figured out what it was. I changed NSURL *fileURL = [NSURL URLWithString:soundFilePath]; to NSURL *fileURL = [NSURL fileURLWithPath:soundFilePath]; to the latter and I was getting a weird error, weirder than the one in the subject BUT I googled that and I changed my OS input device from my webcam to my internal microphone and guess what, it worked under the fileURLWithPath method. I'll be. Damned.

    Read the article

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

    - by slickplaid
    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 *A4; UIButton *Ab4; UIButton *As4; UIButton *G3; UIButton *Gb3; UIButton *Gs3; UIButton *F3; UIButton *Fs3; UIButton *E3; UIButton *Eb3; UIButton *D3; UIButton *Db3; UIButton *Ds3; UIButton *C3; UIButton *Cs3; } @property (nonatomic, retain) AVAudioPlayer *player; @property (nonatomic, retain) IBOutlet UIButton *C4; @property (nonatomic, retain) IBOutlet UIButton *B4; @property (nonatomic, retain) IBOutlet UIButton *Bb4; @property (nonatomic, retain) IBOutlet UIButton *A4; @property (nonatomic, retain) IBOutlet UIButton *Ab4; @property (nonatomic, retain) IBOutlet UIButton *As4; @property (nonatomic, retain) IBOutlet UIButton *G3; @property (nonatomic, retain) IBOutlet UIButton *Gb3; @property (nonatomic, retain) IBOutlet UIButton *Gs3; @property (nonatomic, retain) IBOutlet UIButton *F3; @property (nonatomic, retain) IBOutlet UIButton *Fs3; @property (nonatomic, retain) IBOutlet UIButton *E3; @property (nonatomic, retain) IBOutlet UIButton *Eb3; @property (nonatomic, retain) IBOutlet UIButton *D3; @property (nonatomic, retain) IBOutlet UIButton *Db3; @property (nonatomic, retain) IBOutlet UIButton *Ds3; @property (nonatomic, retain) IBOutlet UIButton *C3; @property (nonatomic, retain) IBOutlet UIButton *Cs3; - (IBAction) playNote; @end Buttons are all linked to the event "playNote" in interfaceBuilder and each note is linked to the proper referencing outlet according to note name. All *.mp3 sound files are named after the UIButton name (IE- C3 == C3.mp3). In my implementation file, I have this to play a only one note when the C3 button is pressed: #import "sonicfitViewController.h" @implementation appViewController @synthesize C3, Cs3, D3, Ds3, Db3, E3, Eb3, F3, Fs3, G3, Gs3, A4, Ab4, As4, B4, Bb4, C4; // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { NSString *path = [[NSBundle mainBundle] pathForResource:@"3C" ofType:@"mp3"]; NSLog(@"path: %@", path); NSURL *file = [[NSURL alloc] initFileURLWithPath:path]; AVAudioPlayer *p = [[AVAudioPlayer alloc] initWithContentsOfURL:file error:nil]; [file release]; self.player = p; [p release]; [player prepareToPlay]; [player setDelegate:self]; [super viewDidLoad]; } - (IBAction) playNote { [self.player play]; } Now, with the above I have two issues: First, the NSLog reports NULL and crashes when trying to play the file. I have added the mp3's to the resources folder and they have been copied and not just linked. They are not in an subfolder under the resources folder. Secondly, how can I set it up so that when say button C3 is pressed, it plays C3.mp3 and F3 plays F3.mp3 without writing duplicate lines of code for each different button? playNote should be like NSString *path = [[NSBundle mainBundle] pathForResource:nameOfButton ofType:@"mp3"]; instead of defining it specifically (@"C3"). Is there a better way of doing this and why does the *path report NULL and crash when I load the app? I'm pretty sure it's something as simple as adding additional variable inputs to - (IBAction) playNote:buttonName and putting all the code to call AVAudioPlayer in the playNote function but I'm unsure of the code to do this.

    Read the article

  • Record AVAudioPlayer output using AVAudioRecorder

    - by Kieran
    In my app the user plays a sound by pressing a button. There are several buttons which can be played simultaneously. The sounds are played using AVAudioPlayer instances. I want to record the output of these instances using AVAudioRecorder. I have set it all up and a file is created and records but when I play it back it does not play any sound. It is just a silent file the length of the recording. Does anyone know if there is a setting I am missing with AVAudioPlayer or AVAudioRecorder? Thanks

    Read the article

  • What do you use to play sound in iPhone games?

    - by zoul
    Hello! I have a performance-intensive iPhone game I would like to add sounds to. There seem to be about three main choices: (1) AVAudioPlayer, (2) Audio Queues and (3) OpenAL. I’d hate to write pages of low-level code just to play a sample, so that I would like to use AVAudioPlayer. The problem is that it seems to kill the performace – I’ve done a simple measuring using CFAbsoluteTimeGetCurrent and the play message seems to take somewhere from 9 to 30 ms to finish. That’s quite miserable, considering that 25 ms == 40 fps. Of course there is the prepareToPlay method that should speed things up. That’s why I wrote a simple class that keeps several AVAudioPlayers at its disposal, prepares them beforehand and then plays the sample using the prepared player. No cigar, still it takes the ~20 ms I mentioned above. Such performance is unusable for games, so what do you use to play sounds with a decent performance on iPhone? Am I doing something wrong with the AVAudioPlayer? Do you play sounds with Audio Queues? (I’ve written something akin to AVAudioPlayer before 2.2 came out and I would love to spare that experience.) Do you use OpenAL? If yes, is there a simple way to play sounds with OpenAL, or do you have to write pages of code? Update: Yes, playing sounds with OpenAL is fairly simple.

    Read the article

  • How do you control the playback levels (decibles?) using the iPhone AVAudioPlayer? Or do I need to u

    - by Joshua
    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 found in the library http://developer.apple.com/iphone/library/documentation/AVFoundation/Reference/AVAudioPlayerClassReference/Reference/Reference.html#//apple_ref/doc/uid/TP40008067-CH1-SW2 that it says that you can "Control relative playback level for each sound you are playing" but I've been searching this issue out for hours and I haven't gotten anywhere. Any help would be wonderful!

    Read the article

  • AVAudioPlayer problem regarding song overlaping in iPhone

    - by riteshkumar1905
    I have using AVAudioPlayer in my app but the problem is that when i play the song from list it will played while before stopping the song i am again goes to song list then select another song then both song will start playing simultaneously so please tell me the code which will terminate my first song. i am using avTouchContoller & avTouchViewController in my app. so i am enclosing the code for song which is written in avController.m & avTouchViewController.m as follow for single song avtouchController.m switch (flag) { case 1: //[self stop]; fileURL = [[NSURL alloc] initFileURLWithPath: [[NSBundle mainBundle] pathForResource:@"Aarti Keeje" ofType:@"aac"]]; self._player = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:nil]; //self._player=newplayer; //[newplayer release]; if (self._player) { _fileName.text = [NSString stringWithFormat: @"%@ (%d ch.)", [[self._player.url relativePath] lastPathComponent], self._player.numberOfChannels, nil]; [self updateViewForPlayerInfo]; [self updateViewForPlayerState]; } [fileURL release]; break;

    Read the article

  • Avaudioplayer problem regarding songs

    - by Arun Sharma
    I am using avaudioplayer for playing mp3 songs. The problem is in being able to catch the instance of the player to control it i.e. Stop it, Play it etc. The code by default creates multiple instances of the same player and overlaps the songs. I am being unable to reference the player specifically. Do you have an idea as to how we can do so? Thanks Arun Sharma

    Read the article

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

    - by iSharreth
    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 it automatically replay after its end? Anyone please help.

    Read the article

  • AVAudioPlayer lag when calling play

    - by joec
    I have set up an AVAudioPlayer object in viewDidLoad, as per the Apple guidelines, calling prepareToPlay as the last line in viewDidLoad (i have tried in awakeFromNib also). When i press my play button, there is a pause, as it would appear to load the file, then it plays. In audioPlayerDidFinishPlaying, i reload the player with a different sound, and when clicking play for a second time, the file plays instantly. What would cause the player to lag on the first play? Thanks.

    Read the article

  • help me pick the right iPhone audio class - MPMoviePlayer vs AVAudioPlayer vs MPMusicPlayer

    - by huevos de oro
    Does anyone know of a good tutorial on the distinction between the MPMoviePlayer vs AVAudioPlayer vs MPMusicPlayer? I want to play audio from an mp3 file available at an external URL. Ideally it is played in an iPod-like audio view. I toyed with MPMoviePlayer but it appears to be more suitable for video, as when audio starts a "movie playing" message displays, the controls disappear and a white quicktime splash page displays. I would like the standard ipod audio controls to display all the time, and to customize the image behind them.

    Read the article

  • Problems playing multiple sounds using AVPlayer (NOT AVAudioPlayer)

    - by myetter37
    I'm trying to play a background song in my iPhone game and also have sound effects, using the AVFoundation framework and AVPlayerItem. I've scoured the Internet for help with AVPlayerItem and AVPlayer but I'm only finding stuff about AVAudioPlayer. The background song plays fine, but when the character jumps, I have 2 problems: 1) On the initial jump ([player play] inside jump method), the jump sound effect interrupts the background music. 2) If I try to jump again, the game crashes with the error "AVPlayerItem cannot be associated with more than one instance of AVPlayer" My professor told me to create a new instance of AVPlayer for each sound I want to play, so I'm confused. I'm doing data driven design, so my sound files are listed in a .txt and then loaded into a NSDictionary. Here's my code: - (void) storeSoundNamed:(NSString *) soundName withFileName:(NSString *) soundFileName { NSURL *assetURL = [[NSURL alloc] initFileURLWithPath:[[NSBundle mainBundle] pathForResource:soundName ofType:soundFileName]]; AVURLAsset *mAsset = [[AVURLAsset alloc] initWithURL:assetURL options:nil]; AVPlayerItem *mPlayerItem = [AVPlayerItem playerItemWithAsset:mAsset]; [soundDictionary setObject:mPlayerItem forKey:soundName]; NSLog(@"Sound added."); } - (void) playSound:(NSString *) soundName { // from .h: @property AVPlayer *mPlayer; // from .m: @synthesize mPlayer = _mPlayer; _mPlayer = [[AVPlayer alloc] initWithPlayerItem:[soundDictionary valueForKey:soundName]]; [_mPlayer play]; NSLog(@"Playing sound."); } If I move this line from the second method into the first: _mPlayer = [[AVPlayer alloc] initWithPlayerItem:[soundDictionary valueForKey:soundName]]; The game does not crash, and the background song will play perfectly, but the jump sound effect does not play, even though the console is showing "Playing sound." on each jump. Thank you

    Read the article

  • Objective-c - How to serialize audio file into small packets that can be played?

    - by vfn
    Hi there, So, I would like to get a sound file and convert it in packets, and send it to another computer. I would like that the other computer be able to play the packets as they arrive. I am using AVAudioPlayer to try to play this packets, but I couldn't find a proper way to serialize the data on the peer1 that the peer2 can play. The scenario is, peer1 has a audio file, split the audio file in many small packets, put them on a NSData and send them to peer2. Peer 2 receive the packets and play one by one, as they arrive. Does anyone have know how to do this? or even if it is possible? EDIT: Here it is some piece of code to illustrate what I would like to achieve. // This code is part of the peer1, the one who sends the data - (void)sendData { int packetId = 0; NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"myAudioFile" ofType:@"wav"]; NSData *soundData = [[NSData alloc] initWithContentsOfFile:soundFilePath]; NSMutableArray *arraySoundData = [[NSMutableArray alloc] init]; // Spliting the audio in 2 pieces // This is only an illustration // The idea is to split the data into multiple pieces // dependin on the size of the file to be sent NSRange soundRange; soundRange.length = [soundData length]/2; soundRange.location = 0; [arraySoundData addObject:[soundData subdataWithRange:soundRange]]; soundRange.length = [soundData length]/2; soundRange.location = [soundData length]/2; [arraySoundData addObject:[soundData subdataWithRange:soundRange]]; for (int i=0; i // This is the code on peer2 that would receive an play the piece of audio on each packet - (void) receiveData:(NSData *)data { NSKeyedUnarchiver* unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data]; if ([unarchiver containsValueForKey:PACKET_ID]) NSLog(@"DECODED PACKET_ID: %i", [unarchiver decodeIntForKey:PACKET_ID]); if ([unarchiver containsValueForKey:PACKET_SOUND_DATA]) { NSLog(@"DECODED sound"); NSData *sound = (NSData *)[unarchiver decodeObjectForKey:PACKET_SOUND_DATA]; if (sound == nil) { NSLog(@"sound is nil!"); } else { NSLog(@"sound is not nil!"); AVAudioPlayer *audioPlayer = [AVAudioPlayer alloc]; if ([audioPlayer initWithData:sound error:nil]) { [audioPlayer prepareToPlay]; [audioPlayer play]; } else { [audioPlayer release]; NSLog(@"Player couldn't load data"); } } } [unarchiver release]; } So, here is what I am trying to achieve...so, what I really need to know is how to create the packets, so peer2 can play the audio. It would be a kind of streaming. Yes, for now I am not worried about the order that the packet are received or played...I only need to get the sound sliced and them be able to play each piece, each slice, without need to wait for the whole file be received by peer2. Thanks!

    Read the article

  • "Cannot find executable for CFBundle/CFPlugIn" error

    - by Emil
    Cannot find executable for CFBundle/CFPlugIn 0x432bfa0 </Library/Audio/Plug-Ins/HAL/DVCPROHDAudio.plugin> (not loaded) Cannot find function pointer NewPlugIn for factory C5A4CE5B-0BB8-11D8-9D75-0003939615B6 in CFBundle/CFPlugIn 0x432bfa0 </Library/Audio/Plug-Ins/HAL/DVCPROHDAudio.plugin> (not loaded) That's the error I get when I try to run this code: NSString *path = [[NSBundle mainBundle] pathForResource:[arraySubFarts objectAtIndex:indexPath.row] ofType:@"mp3"]; NSURL *file = [[NSURL alloc] initFileURLWithPath:path]; AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:file error:nil]; self.player = player; [player prepareToPlay]; [player setDelegate:self]; [self.player play]; Any idea why? :S I have included the needed frameworks, and the code works great, the only thing is this odd Console-message..

    Read the article

  • Playing audio from a wav file in iPhone SpeakHere example

    - by Mo
    I'm working with the iPhone SpeakHere example, and I would like to be able to play audio from either the mic (as in the example) or from a wav file. I have working code to play from a particular wav file, which looks like this: NSString *path = [[NSBundle mainBundle] pathForResource:@"basketBall" ofType:@"wav"]; AVAudioPlayer* theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL]; theAudio.delegate = self; [theAudio play]; So I'm fine with actually getting the wav to play in the application (I can hook it up to a button, etc.) but I would like it to also behave the same way pushing the "Play" button does after recorded speech, in that it should be connected to the same visualization (which I have modified quite a bit, but essentially shows the current volume, among other things). Thanks for your help!

    Read the article

  • How to play audio file ios

    - by Camus
    I am trying to play an audio file but I can get it working. I imported the AVFoundation framework. Here is the code: NSString *fileName = [[NSBundle mainBundle] pathForResource:@"Alarm" ofType:@"caf"]; NSURL *url = [[NSURL alloc] initFileURLWithPath:fileName]; NSLog(@"Test: %@ ", url); AVAudioPlayer *audioFile = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:NULL]; audioFile.delegate = self; audioFile.volume = 1; [audioFile play]; I am receiving an error nil string parameter I copied the file to the supporting files folder so the file is there. Can you guys help me? Thanks

    Read the article

  • AVFoundation: Video to OpenGL texture working - How to play and sync audio?

    - by j00hi
    I've managed to load a video-track of a movie frame by frame into a OpenGL texture with AVFoundation. I followed the steps described in the answer here: iOS4: how do I use video file as an OpenGL texture? and took some code from the GLVideoFrame sample from WWDC2010 which can be downloaded here: http://bit.ly/cEf0rM How do I play the audio-track of the movie synchronously to the video. I think it would not be a good idea to play it in a separate player, but to use the audio-track of the same AVAsset. AVAssetTrack* audioTrack = [[asset tracksWithMediaType:AVMediaTypeAudio] objectAtIndex:0]; I retrieve a videoframe and it's timestamp in the CADisplayLink-callback via CMSampleBufferRef sampleBuffer = [self.readerOutput copyNextSampleBuffer]; CMTime timestamp = CMSampleBufferGetPresentationTimeStamp( sampleBuffer ); where readerOutput is of type AVAssetReaderTrackOutput* How to get the corresponding audio-samples? And how to play them? Edit: I've looked around a bit and I think, best would be to use AudioQueue from the AudioToolbox.framework using the approach described here: AVAssetReader and Audio Queue streaming problem There is also an audio-player in the AVFoundation: AVAudioPlayer. But I don't know exactly how I should pass data to it's initWithData-initializer which expects NSData. Furthermore I don't think it's the best choice for my case because a new AVAudioPlayer-instance would have to be created for every new chunk of audio samples, as I understand it. Any other suggestions? What's the best way to play the raw audio samples which i get from the AVAssetReaderTrackOutput?

    Read the article

  • Can AVAudioSession do full duplex?

    - by Eric Christensen
    It would seem like it should be able to, but the following breakout test code can't do both: //play a file: NSArray *pathsArray = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [pathsArray objectAtIndex:0]; NSString* playFilePath=[documentsDirectory stringByAppendingPathComponent:@"testplayfile.wav"]; AVAudioPlayer *tempplayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:playFilePath] error:nil]; [tempplayer prepareToPlay]; [tempplayer play]; //and record a file: NSString* recFilePath=[documentsDirectory stringByAppendingPathComponent:@"testrecordfile.wav"]; AVAudioRecording *soundrecording = [[AVAudioRecorder alloc] initWithURL:[NSURL fileURLWithPath:recFilePath] settings:nil error:nil]; [soundrecording prepareToRecord]; [soundrecording record]; This is the minimum I can think of to individually play one file and record another. And this works just fine in the simulator. I can play back a file and record at the same time. But it doesn't work on the iphone itself. If I comment out either function, the other performs fine. The playback plays fine either alone or with both, if it's first. If I comment out the playback, the record records fine. (There's additional code to stop the recording not shown here.) So each works fine, but not together. I know audioQueue has a setting to allow both, but I don't see an analogue for AVAudioSessions. Any idea if it's possible, and if so, what I need to add? Thanks!

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >