Tone.js icon indicating copy to clipboard operation
Tone.js copied to clipboard

Access User Input Media Stream

Open paulyorde opened this issue 3 years ago • 1 comments

UserMedia.open( stream => _stream = stream )

Currently UserMedia marks the stream as private _stream. Ideally, I would like to capture the stream, create a mediaStreamSource and connect it to an Analyzer. This is to visualize and or assess the input coming in.

Maybe you have something that does this is already?

I have accessed it by typescript using stream['_stream'];

https://github.com/Tonejs/Tone.js/blob/dev/Tone/source/UserMedia.ts

paulyorde avatar Jul 11 '22 22:07 paulyorde

Wrapping the media stream into a mediaStreamSource is exactly what the class currently does. Could you connect the UserMedia directly to an Analyser? something like this:

const um = new UserMedia();
const analyser = new Analyser();
um.connect(analyser);
await um.open()

tambien avatar Sep 03 '22 14:09 tambien