Hi, i have a question about recording audio with type kAudioFileMP3Type. Please help me!
Hi, i have a question about recording audio with type kAudioFileMP3Type. Currently, i have developed one example recording audio, i choice type kAudioFileMP3Type, however when go to step [_recorder beginRecordingToFileAtPath:path fileType:kAudioFileMP3Type error:&error]. it showed error: Error Domain=NSOSStatusErrorDomain Code=1718449215 "Couldn't open the output file (error 1718449215/fmt?)" UserInfo={NSLocalizedDescription=Couldn't open the output file (error 1718449215/fmt?). Please help me check what is wrong. Thank you.
Comments
@thaovm,
Would you consider recording to M4A file format, rather than MP3?
Here's an answer that I found about recording to MP3 format by Duncan C:
Apple's libraries support reading MP3, but not writing it. I believe there is a licensing issue with writing MP3. The popular Audacity sound editor can read MP3 files fine, but in order to write them, you have to install the open source LAME library.
I found this quote in the Xcode docs (it's confusing whether it relates to iOS or Mac OS:
Some formats have restrictions; for example, by default, Core Audio can read, but not write, MP3 files.
Source:
http://iphonedevsdk.com/forum/iphone-sdk-development/99242-record-mp3-instead-of-caf-file.html
@markjeschke
Thanks you the support of you. I think that is great, however my problem is not simple. Really, i am developing an application record audio and camera, so i use TAAE and GPUImage together, then i have a problem that is not record audio by TAAE when i start record camera by GPUImage. i have not known how to fix it yet. But thanks you so much for the support!
@thaovm,
You're welcome. I'm happy to help. Without seeing your code, have you tried adding an NSNotification that can automatically toggle TAAE's recording start/stop method when your GPUImage's camera begins recording?
If you're unfamiliar with NSNotifications, here's a basic usage tutorial:
https://www.hackingwithswift.com/example-code/system/how-to-post-messages-using-nsnotificationcenter
@markjeschke
Thank you so much. Lucky, i just resolved this problem. i am very happy
@thaovm,
Would you mind sharing your solution with TAAE community? A code snippet or explanation, please?
Thanks,
Mark