avaudioplayer

AVAudioPlayer NOT playing through speaker after recording with AVAudioRecorder

拜拜、爱过 提交于 2021-01-07 03:24:18
问题 I'm working on an app that does audio recording and playback of recorded audio. I'm using AVAudioSession to change the category to playAndRecord as well as passing it to defaultToSpeaker . My problem is , if I launch the app, play an earlier recording, it plays through the bottom (louder) speaker as I want it to and expected BUT if I launch the app and start recording a new memo then play it back, no matter what I do, it will always use the quieter (phone call) speaker that's next to front

Is anyone else getting this console message with AVAudioPlayer in Xcode 11 (and 11.1)?

拟墨画扇 提交于 2021-01-01 07:04:32
问题 I have a simple example program with AVAudioPlayer and am getting this message when I run it. This occurs before .play() is called: 2019-10-08 12:34:53.093726+1100 PlayNotes2[1587:137643] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600000c580e0> F8BB1C28-BAE8-11D6-9C31-00039315CD46 The program works fine, but I'm concerned to be getting this message. Here is my complete code. It just has one button on the view with the playButtonTap outlet. Note that the same thing

Is anyone else getting this console message with AVAudioPlayer in Xcode 11 (and 11.1)?

我的梦境 提交于 2021-01-01 07:03:07
问题 I have a simple example program with AVAudioPlayer and am getting this message when I run it. This occurs before .play() is called: 2019-10-08 12:34:53.093726+1100 PlayNotes2[1587:137643] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600000c580e0> F8BB1C28-BAE8-11D6-9C31-00039315CD46 The program works fine, but I'm concerned to be getting this message. Here is my complete code. It just has one button on the view with the playButtonTap outlet. Note that the same thing

Repeating Audio playback with AVAudioPlayer

隐身守侯 提交于 2020-05-17 06:29:05
问题 I'm using AVAudioPlayer and want that the user can restart the playback once the loop is played back. For the user feedback I used UIAlertController but I still struggle to get the replay done with AVAudioPlayer. I want that the user can choose replay as often as he like until he choose NO. Here is my code I have so far, but what to do if the user select YES ... see comment in code below. // schedule the audio file [self->_playerNode scheduleFile:self->_file atTime:nil completionHandler:^{

AVAudioPlayer iOS Error

試著忘記壹切 提交于 2020-04-21 01:24:14
问题 I get an error trying to play a clip using AVAudioPlayer. The error gives me: 'The operation couldn’t be completed. (OSStatus error -50.)' I have no idea. The frameworks are all there etc... Is it something to do with the URL? Here's my code: NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"grunt" ofType:@"aiff"]; NSURL *fileURL = [NSURL URLWithString:soundFilePath]; NSError *error; audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:&error]; if(!error){

AVAudioPlayer iOS Error

*爱你&永不变心* 提交于 2020-04-21 01:15:09
问题 I get an error trying to play a clip using AVAudioPlayer. The error gives me: 'The operation couldn’t be completed. (OSStatus error -50.)' I have no idea. The frameworks are all there etc... Is it something to do with the URL? Here's my code: NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"grunt" ofType:@"aiff"]; NSURL *fileURL = [NSURL URLWithString:soundFilePath]; NSError *error; audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:&error]; if(!error){

AVAudioPlayer iOS Error

北战南征 提交于 2020-04-21 01:11:59
问题 I get an error trying to play a clip using AVAudioPlayer. The error gives me: 'The operation couldn’t be completed. (OSStatus error -50.)' I have no idea. The frameworks are all there etc... Is it something to do with the URL? Here's my code: NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"grunt" ofType:@"aiff"]; NSURL *fileURL = [NSURL URLWithString:soundFilePath]; NSError *error; audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:&error]; if(!error){