Now that iPhone 3.0 sdk is public, I think I can ask this question for those of you that have already been playing with the 3.0 sdk. I want to record audio in my application, but I want to use AVAudioRecorder and not the older way of recording like the example SpeakHere shows. There are not any examples of how to best do this in the iPhone Dev Center and only reference to the classes. I am a newbie at iPhone development, so I am looking for a simple sample to get me started. Thanks in advance.
相关问题
- Can we recover audio from MFCC coefficients?
- CALayer - backgroundColor flipped?
- Is there a way to play audio on a mobile browser w
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
Great Thanks to @Massimo Cafaro and Shaybc I was able achieve below tasks
in iOS 8 :
1.Add "AVFoundation.framework" to your project
in .h file
2.Add below import statement 'AVFoundation/AVFoundation.h'.
3.Define "AVAudioRecorderDelegate"
4.Create a layout with Record, Play buttons and their action methids
5.Define Recorder and Player etc.
Here is the complete example code which may help you.
Then do the job in
I have uploaded a sample project. You can take a look.
VoiceRecorder
I've been trying to get this code to work for the last 2 hours and though it showed no error on the simulator, there was one on the device.
Turns out, at least in my case that the error came from directory used (bundle) :
It was not writable or something like this... There was no error except the fact that prepareToRecord failed...
I therefore replaced it by :
It now Works like a Charm.
Hope this helps others.
for wav format below audio setting
ref: http://objective-audio.jp/2010/09/avassetreaderavassetwriter.html
Although this is an answered question (and kind of old) i have decided to post my full working code for others that found it hard to find good working (out of the box) playing and recording example - including encoded, pcm, play via speaker, write to file here it is:
AudioPlayerViewController.h:
AudioPlayerViewController.m:
Hope this will help some of you guys.
Its really helpful. The only problem i had was the size of sound file created after recording. I needed to reduce the file size so i did some changes in settings.
File size reduced from 360kb to just 25kb (2 seconds recording).