avaudiorecorder

Getting byte Data from File

孤人 提交于 2019-12-25 14:39:10
问题 WHAT IM DOING I am trying to get an audio file (could be up to an hour long. eg. a Podcast) that I've recorded with AVAudioRecorder to be uploaded to our backend. In addition to being uploaded to the server it needs to be able to be "Paused" and "Resumed" if the user chooses. Because of this, I believe, I need to use dataWithBytesNoCopy:buffer on the NSData class to achieve this. WHERE IM AT I know for a fact I can get the data with using the passed self.mediaURL property: if (self.mediaURL)

AVAudioRecorder prepareToRecord works, but record fails

别说谁变了你拦得住时间么 提交于 2019-12-25 00:52:49
问题 I just built and tested a basic AVAudioRecorder/AVAudioPlayer sound recorder and player. Eventually I got this working on the device, as well as the simulator. My player/recorder code is in a single UIView subclass. Unfortunately, when I copy the class into my main project, it no longer works (on the device--the simulator is fine). prepareToRecord is working fine, but record isn't. Here is some code: audioRecorder = [[ AVAudioRecorder alloc] initWithURL:url settings:recordSettings error:

AVAudioRecorder stops when lock button is pressed [duplicate]

本小妞迷上赌 提交于 2019-12-24 18:50:32
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: AVAudioRecorder doesn't record while screen is locked I'm trying to get my audio recorder to keep working even when the iphone is locked like apple's Voice Memos app. Currently the lock button seems to call for my recorder to stop. What can I do to keep the recorder on even when the screen is locked until the user actually stops it manually? 回答1: You need configure AVAudioSession Category. NSError *sessionError

Can I convert peakPowerForChannel to dB?

自闭症网瘾萝莉.ら 提交于 2019-12-24 08:08:12
问题 I found that some apps can display a decibel (dB) value for audio level. I have been trying for some time but have not been able to find the relationship between power and dB. Can anybody tell me how to do it ? 回答1: You can use the formula: dB = 10 * log10(power); Note however that dB is a ratio , not an absolute measurement, so your dB values will be somewhat arbitrary unless you calibrate your system. The easiest solution is just to apply an empirically derived dB offset which gives you 0

AVAudioRecorder - Continue recording to file after user stops recording by leaving the application and then re-opens it

你离开我真会死。 提交于 2019-12-24 07:45:52
问题 Can this be done? And if not, how far down towards Core Audio do I need to go (what method of recording should I be using instead)? I've noticed the behavior of AVAudioRecorder is to overwrite a file if it finds one at the path provided when you request that it record again, so I know that's not going to work. I'm also curious about file format restriction with this idea. Can you effectively resume an AAC or IMA4 encoding (the length of the files I want to record make WAV and probably even

How to resume a recording using AVAudioRecorder?

让人想犯罪 __ 提交于 2019-12-23 08:04:59
问题 I am writing an application that uses the AVAudioRecorder class. It works great except for when a phone call comes in. I am handling this per apple's guidelines of using the AVAudioRecorderDelegate methods – (void) audioRecorderBeginInterruption: – (void) audioRecorderEndInterruption: It works great until the interruption ends and I attempt to "resume" the recording by calling the record method again (per the documentation). However it does not resume my recording but instead throws out the

Converting NSData back to Audio File

纵然是瞬间 提交于 2019-12-22 12:16:31
问题 i have converted my .caf audio file to NSData object using the following line of code: NSData *audioData = [NSData dataWithContentsOfFile:[MyRecorderFilePathURL path] options: 0 error:&err]; I am doing so to upload the binary object to a server through a web service. How do i convert audioData back to a .caf file which can be played using AVAudioPlayer ? 回答1: AVAudioPlayer has a method for playing sound from NSData object . You can use - (id)initWithData:(NSData *)data error:(NSError **

Circular Buffer Audio Recording iOS: Possible?

随声附和 提交于 2019-12-22 11:09:36
问题 A client of mine wants to continually record audio and when he clicks submit he wants to submit the last 10 seconds only. So he wants a continual recording and only keeping the last x seconds. I would think this requires something like a circular buffer, but (as a somewhat newbie for iOS) it looks like AVAudioRecorder can only write to a file. Are there any options for me to implement this? Can anyone give a pointer? 回答1: I would use the Audio Queue Services. This will allow you isolate

AVAudioRecorder meter delay on iPad

时光怂恿深爱的人放手 提交于 2019-12-22 09:02:10
问题 I am having trouble getting an accurate meter reading from the AVAudioRecorder (testing on iPad). It seems to work fine while the volume is rising, however a delay happens when the volume drops. For example: I speak into the mic and slowly raise my voice. The readings increment from -35.567 to -34.678 up to -10.579 as I would hope, but when I stop talking there is a delay of 1 - 2 seconds before it drops back down to -35.567 (or whatever it happens to be). The NSLog continues to update from

Setting a time limit when recording an audio clip?

懵懂的女人 提交于 2019-12-22 07:48:29
问题 I looked for search terms along the lines of the post title, but alas.. I am building an iPhone app using AVFoundation. Is there a correct procedure to limit the amount of audio that will be recorded? I would like a maximum of 10 seconds. Thanks for any help/advice/tips/pointers.. 回答1: AVAudioRecorder has the following method: - (BOOL)recordForDuration:(NSTimeInterval)duration I think that will do the trick! http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference