avaudiorecorder

AVAudioRecorder does not create .m4a files that can be opened and played

為{幸葍}努か 提交于 2021-02-06 20:01:45
问题 I am trying to modify an iOS app that can send audio files (securely/encrypted) to other iOS devices. It uses AVAudioRecorder to record the audio files, and it uses AVAudioPlayer to play back any received audio files. I am now trying to modify the app to create and send files that are compatible with Android. I modified the existing AVAudioRecorder code to this: [settings setValue:[NSNumber numberWithInt:kAudioFormatMPEG4AAC] forKey:AVFormatIDKey]; [settings setValue:[NSNumber numberWithInt

AVAudioRecorder does not create .m4a files that can be opened and played

前提是你 提交于 2021-02-06 19:56:40
问题 I am trying to modify an iOS app that can send audio files (securely/encrypted) to other iOS devices. It uses AVAudioRecorder to record the audio files, and it uses AVAudioPlayer to play back any received audio files. I am now trying to modify the app to create and send files that are compatible with Android. I modified the existing AVAudioRecorder code to this: [settings setValue:[NSNumber numberWithInt:kAudioFormatMPEG4AAC] forKey:AVFormatIDKey]; [settings setValue:[NSNumber numberWithInt

AVAudioPlayer NOT playing through speaker after recording with AVAudioRecorder

可紊 提交于 2021-01-07 03:26:58
问题 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

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

ios - convert .m4a to .mp3 file programmatically

百般思念 提交于 2020-04-05 12:21:21
问题 Here i have m4a format audio, I need to convert into mp3 format. for this I used the code as - (void) toMp3{ NSString *m4aFilePath = pathToSave; NSString *mp3FileName = [NSString stringWithFormat:@"Audio%d",[audioArr count]]; mp3FileName = [mp3FileName stringByAppendingString:@".mp3"]; pathToSave = [NSString stringWithFormat:@"%@/%@", DOCUMENTS_FOLDER, mp3FileName]; NSLog(@"pathToSave :%@",pathToSave); @try { int read, write; FILE *pcm = fopen([cafFilePath cStringUsingEncoding:1], "rb"); /

How to encode self-delimited opus in iOS

Deadly 提交于 2020-01-25 07:20:07
问题 I can record opus using AVAudioRecorder as following: let opusRecordingSettings = [AVFormatIDKey: kAudioFormatOpus, AVSampleRateKey: 16000.0, AVNumberOfChannelsKey: 1] as [String: Any] do { try audioRecordingSession.setCategory(.playAndRecord, mode: .default) try audioRecordingSession.setActive(true) audioRecorder = try AVAudioRecorder(url: fileUrl(), settings: opusRecordingSettings) audioRecorder.delegate = self audioRecorder.prepareToRecord() audioRecorder.record() } catch _ { } // ... ...

how can i record a song which is playing with AVPlayer and an wav file at a same time?

梦想的初衷 提交于 2020-01-25 05:01:08
问题 I'm developing an App in which i have to record a song and a wav file at a same time.I'm playing song from iPod Music libraries and on a view controller i have placed a button on click of which an wav file starts but when i start recording using AVAudioRecorder,my wav file stop working. This is my ipod music library's code:- - (void) mediaPicker: (MPMediaPickerController *) mediaPicker didPickMediaItems: (MPMediaItemCollection *) collection { MPMediaItem *item = [[collection items]

Problem in playing & recording sound with two different players

对着背影说爱祢 提交于 2020-01-24 22:16:08
问题 I have implemented two AVAudioPlayer in my iPad project. I am playing sound with one player object and also simultaneously recording with the other player. First Scenario 1.Player1 is recording the words I am speaking. 2.Simultaneously player1 is also recording the music playing with player2. *This scenario is working fine if I am not plugging in any headset with microphone to my iPad. *But, if I plugged in the headset to my iPad & repeat the above scenario, the following points are observed:

combine two .caf audio files into a single audio file in iphone

旧时模样 提交于 2020-01-21 17:23:26
问题 I am using AVAudioRecorder for recording audio in .caf format. When the user will resume this recording the new recording must append with the old recording. So how can i combine two .caf audio files. 回答1: You can do it using ExtAudioFileService. In ios developer library they had provided two examples to convert one audio file to another format. In these they are opening one audio file for reading and another file for writing (converted audio). You can change or updated code to read from two

How can I play a recorded sound using a local notification?

回眸只為那壹抹淺笑 提交于 2020-01-21 06:13:33
问题 I have an app that requires that the user record their own message to be played back at some future time. My intent was to do that using UILocalNotification. Unfortunately, it seems that the sound associated with the local notif has to be stored in the main bundle but the user cannot make a recording and save it in the bundle. How do I get a user recorded sound file to be played via local notification? Alternatively - is there a way if the app is not running to capture the local notification