简体   繁体   English

使用AVAudioRecorder录制时创建2秒音频文件

[英]Create 2 second audio files while recording with AVAudioRecorder

i am using AVAudioRecorder to record the iphone input. 我正在使用AVAudioRecorder来录制iphone输入。 i need to create a file from the recored every 2 seconds (while recording) without damaging the main file i am recording. 我需要每2秒(在录制时)从记录中创建一个文件,而不会损坏我正在录制的主文件。

Example: 例:

lets say i am recording a 10 secondes file 让我说我正在录制一个10 secondes文件

------------------
    10 Seconds

during the recording i need to create 2 seconds "chunks" ready to be sent over POST request. 在录制过程中,我需要创建2秒“块”,准备通过POST请求发送。

--  --  --  --  --
 2   2   2   2   2

any head start? 任何先声夺人?

to manage this i found out that i must use apple's Audio Queue Services which is ac based API. 管理这个我发现我必须使用苹果的Audio Queue Services ,这是基于交流的API。 here is a link 这是一个链接

this stuff is really cool! 这东西真的很酷!

Do you really need to break the audio file into 2-second chunks for sending over a POST request? 你真的需要将音频文件分成2秒的块来通过POST请求发送吗? Can't you send out the data using multipart form data? 你不能使用多部分表格数据发送数据吗?

Try using an API like ASIHTTPRequest to send out the audio file over the request. 尝试使用ASIHTTPRequest之类的API通过请求发送音频文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM