W3C home > Mailing lists > Public > public-media-capture@w3.org > August 2014

Re: Extending MediaRecorder to record from Web Audio node faster than real time?

From: Jim Barnett <1jhbarnett@gmail.com>
Date: Tue, 26 Aug 2014 21:05:27 -0400
Cc: Robert O'Callahan <robert@ocallahan.org>, "public-media-capture@w3.org" <public-media-capture@w3.org>
Message-Id: <6F3C650B-BF93-4CCC-9A49-67D27BEBD438@gmail.com>
To: Chris Wilson <cwilso@google.com>
It looks like there's a legitimate use case here, but there are details to be worked out and specs to be  coordinated.  Can we handle this on this list, or do we want to set aside some time at the Tech Plenary?

Jim Barnett

> On Aug 26, 2014, at 6:10 PM, Chris Wilson <cwilso@google.com> wrote:
> Well, the OfflineAudioContext is currently defined to be recording itself (to an AudioBuffer) at all times (the oncomplete event has an AudioBuffer of the rendered content).  We would probably want to change that in order when used with MediaRecorder to enable it to be more progressive and not require it to keep buffering the entire output, particularly for long renderings.
>> On Tue, Aug 26, 2014 at 3:03 PM, Robert O'Callahan <robert@ocallahan.org> wrote:
>>> On Wed, Aug 27, 2014 at 2:15 AM, Jim Barnett <1jhbarnett@gmail.com> wrote:
>>> If we can construct MediaStreams from AudioNodes (other than OfflineAudioContext), then there is no need to pass them directly to MediaRecorder, is there?
>> Correct. (Though it's nice to not have to create the MediaStreamAudioDestinationNode, so people will probably still use this constructor with regular AudioContexts.)
>>> If that's so, the only case we have to worry about is OfflineAudioContext, since from previous emails I gather that we don't want to allow it to be used to construct a MediaStream.  As long as it can produce the required amounts of data (e.g. 200ms buffers) I don't see a problem.  On the other hand, for my edification, if OfflineAudioContext can produce data in faster than real time, isn't it already recorded/stored in some way? What is the MediaRecorder for? Transcoding?
>> An OfflineAudioContext is a WebAudio AudioContext that does not produce speaker output and runs "as fast as possible" instead of being tied to a real-time audio clock. So, some use cases for OfflineAudioContext + MediaRecorder:
>> -- Transcode audio files (using AudioContext.decodeAudioData for the input)
>> -- Edit audio files (adjust gain, adjust playback rate, extract segment, etc)
>> -- Synthesize music and record the result
>> As you note, since OfflineAudioContext can't play audio to speakers, most of its use cases require some kind of recording. Currently you can capture samples using a ScriptProcessorNode and compress them in JS (trivial if you're generating WAV files...) but obviously it's better to allow MediaRecorder to be used here.
>> Rob
>> -- 
>> oIo otoeololo oyooouo otohoaoto oaonoyooonoeo owohooo oioso oaonogoroyo
>> owoiotoho oao oboroootohoeoro oooro osoiosotoeoro owoiololo oboeo
>> osouobojoeocoto otooo ojouodogomoeonoto.o oAogoaoiono,o oaonoyooonoeo owohooo
>> osoaoyoso otooo oao oboroootohoeoro oooro osoiosotoeoro,o o‘oRoaocoao,o’o oioso
>> oaonosowoeoroaoboloeo otooo otohoeo ocooouoroto.o oAonodo oaonoyooonoeo owohooo
>> osoaoyoso,o o‘oYooouo ofooooolo!o’o owoiololo oboeo oiono odoaonogoeoro ooofo
>> otohoeo ofoioroeo ooofo ohoeololo.

Received on Wednesday, 27 August 2014 01:05:57 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:26:29 UTC