Any way to have two MediaRecorders recording at once?

All your problems with Audio, Video and Images.

Any way to have two MediaRecorders recording at once?

Postby bbuckley » Tue Nov 11, 2008 3:33 pm

Hi all,
For my app I need to have two audio recordings that overlap each other - that is, at some points in time there will be two separate audio files being created from the same audio source. I have attempted to use two MediaRecorders and start the second one while the first is still recording. When I do this I get the following error:

ERROR/AudioFlinger(25): Record channel already open

Is there any way to get around this?

Thanks in advance,
Blake
bbuckley
Freshman
Freshman
 
Posts: 3
Joined: Wed Oct 15, 2008 5:40 pm
Location: Dallas, TX

Top

Postby MrSnowflake » Tue Nov 11, 2008 3:37 pm

Keep record of the time when the 2nd recorder should start and stop and then use these timestamps to create a 2nd audio stream. So you only have 1 audio file/stream, but you have something like bookmarks.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby bbuckley » Tue Nov 11, 2008 4:44 pm

That's a good idea, but doesn't work for what I need to do.

I need to create a "sliding window" effect in the recording, so that there is always 15 seconds of audio history recorded. I wanted to stair-step two 20-second recorders so that every 5 seconds I would delete one audio recording file when its "history" got too long, then restart it. In this way, there would at most be two files of 20 seconds of audio on the SDcard and not get too large.

If I can't have two recorders recording, is there any way to:

- direct the audio recording stream to multiple files?
- buffer the audio recording so that I can manage the recording size in-memory?
- other creative ideas to accomplish the "sliding window" effect?

Thanks
bbuckley
Freshman
Freshman
 
Posts: 3
Joined: Wed Oct 15, 2008 5:40 pm
Location: Dallas, TX

Postby bbuckley » Wed Nov 12, 2008 9:12 pm

FYI, the word I got from the Google Android Developers group is that the current API does not support two open recording channels. He said the audio API's will be enhanced in future releases of the SDK, but did not indicate if this particular use case would be supported.

Also, to perform two recordings back-to-back using MediaRecorders, you must wait ~100ms (in my testing) to start the second recording. Otherwise you will encounter the same "Record channel already open" error.
bbuckley
Freshman
Freshman
 
Posts: 3
Joined: Wed Oct 15, 2008 5:40 pm
Location: Dallas, TX

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 11 guests