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

Harald Alvestrand <harald@alvestrand.no> ©ó 2014/8/20 ¤U¤È6:57 ¼g¹D¡G

> On 08/19/2014 10:23 AM, John Lin wrote:
>> Hi all,
>>  Currently MediaRecorder only records data from media stream, AIUI [1], is a real time source. That means recording would take as long as content duration.
>>  Some use cases, such as cropping and cropping 1st half of an one hour speech audio clip, would not be very useful if saving the result needs such a long time to complete.
>>  Web Audio API already defines OfflineAudioContext [2] to support processing faster than real time use cases.
>>  By adding a new Constructor to MediaRecoder API:
>> 
>>    Constructor(AudioNode node, optional unsigned long output = 0, optional MediaRecorderOptions options)
>> 
>>  web applications can implement use cases that need to save processed audio with OfflineAudioContext and MediaRecorder.
>> 
>>  What do you think?
> 
> Hmm.... this has more hair than most things, but mostly behind the
> scenes; it's already possible to specify using
> http://webaudio.github.io/web-audio-api/#the-mediastreamaudiodestinationnode-interface
> 
> destiationNode = new MediaStreamAudioDestinationNode()
> recorder = new MediaRecorder(destinationNode.stream)
> But having MediaStreams that are not linked to a clock at all - we might
> have to think about that; what happens if we link a stream from an
> OfflineAudioContext to a PeerConnection?

 Don¡¦t think that would work. My impression after reading spec is that the whole purpose of OfflineAudioContext is to provide non-real-time (as quick as possible) processing, while media stream in WebRTC should be real-time. The word ¡§real-time¡¨ is in the spec title, after all. :-)

> 
> Since it's an apparently legal thing to do, it SHOULD have a well
> defined behaviour - but I'm not sure whether the result should be "no,
> you can't do that" or whether it should do something useful in all cases.


 My vote goes to ¡§NO¡¨, obviously. :-)

>> 
>> [1] final paragraph of http://www.w3.org/TR/mediacapture-streams/#introduction
>> [2] http://webaudio.github.io/web-audio-api/#the-offlineaudiocontext-interface
>> 
>> ¡X
>> John

Received on Thursday, 21 August 2014 09:11:23 UTC