Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is MediaStreamTrackGenerator for audio necessary? #31

Closed
youennf opened this issue May 4, 2021 · 3 comments
Closed

Is MediaStreamTrackGenerator for audio necessary? #31

youennf opened this issue May 4, 2021 · 3 comments

Comments

@youennf
Copy link
Contributor

youennf commented May 4, 2021

Extracting this discussion from #4 (comment), since this was not really fully discussed there.
The use cases for MediaStreamTrackGenerator for audio are unclear given its functionality largely overlaps with what WebAudio can do, WebAudio being already largely deployed in all major browsers.

@youennf
Copy link
Contributor Author

youennf commented May 4, 2021

MediaStreamTrackGenerator can be implemented by using AudioWorklet+MediaStreamAudioDestinationNode.
We should document the use-cases where a native MediaStreamTrackGenerator API is superior to the above approach.
We should also document the use-cases where AudioWorklet is superior to MediaStreamTrackGenerator.

@youennf
Copy link
Contributor Author

youennf commented May 4, 2021

One benefit of AudioWorklet is that the application has full control of cases like: 'there is no more buffered data, what should I do?'. Applications may decide to reduce volume, fake some sound...

With MediaStreamTrackGenerator, the application has no way to react on this case.
Its sole approach is to pile enough data that the audio renderer will never get in that 'no more buffered data' case.
This is especially difficult when processing is done in main thread or when application is planned to be run on very diverse devices.

@guidou
Copy link
Contributor

guidou commented Jun 18, 2021

I think we can treat this as a duplicate of issue #29 since the issue would be audio support in general, so closing.
Please reopen if you think audio support for generator/processor should be treated separately.

@guidou guidou closed this as completed Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants