Sunday, December 8, 2013

AVAudioRecorder recording problems

I AVAudioRecorder implemented on an IPhone recording function: first recording 5 seconds, and then the full audio file recorded for analysis. But then I found the recording with the specified record for duration 5 seconds to go to resolve the recorded audio file there is a problem, find the recording function is the President into a file header, if there is a subsequent operation, the first implementation of the follow-up code, rather than recording, Until completion of the follow-up code runs really recording.
I had wanted to put a thread inside the recording, start recording thread, and then parse, but later found it IPhone this recording function is very strange, it's not my start recording began recording, it is to follow instructions are executed, only recording.
See someone on the Internet can be achieved while recording while playing, but this only needs to deal with a piece of data, and our needs vary greatly, not applicable.
Who has no solution.
Reply:
Try record + timer
Reply:

Already tried, I was thinking about the first recording, and then processed and analyzed inside the OnTimer event, an interval of a few seconds, but before commissioning OnTimer found inside the code is executed, there is no actual recording, just fill it generates an audio file write a file header.

Reply:
I guess you probably have a problem somewhere.
Apple this library does not exist you say that the problem inside the recording process is this:
1, preparation, checking device, the setting, the audio file assigned address. This process will produce the file header.
2, start recording, this time, or before, write the file header to the audio file. Real-time data recording is saved in the built-in memory buffer is full or until the end of the recording, the audio file will be written from memory.
3, end, finishing operation.

5s certainly not filled with the memory buffer, stop what you look at. I have tried both methods you said the problem does not exist.

No comments:

Post a Comment