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

This is again recording from microphone, not from audiooutput device #14

Open
technofreak1 opened this issue Jan 13, 2019 · 4 comments
Open

Comments

@technofreak1
Copy link

Since this was not working on latest chrome 71, I downgraded to chrome 60. I see that this program is recording from microphone instead from speechSynthesis.speak(). I feel the reason is because both audioinput and audiooutput have same deviceId="default". So how can I make it record from speak() ?

@guest271314
Copy link
Owner

@technofreak1 The current code is a proof of concept of a workaround to record speechSynthesis audio output, see https://lists.w3.org/Archives/Public/public-speech-api/2017Jun/0000.html. speechSynthesis.speak() was not implemented at browsers with the functionality to capture audio output.

Technically, at Chromium/Chrome Native Messaging could be utilized to call espeak or espeak-ng directly, How to programmatically send a unix socket command to a system server autospawned by browser or convert JavaScript to C++ souce code for Chromium?. Unfortunately the completed code to achieve the above was lost and have not yet re-written the code, though it should be possible to gather the gist of the procedure from the links.

To answer your question directly, it was not possible (last time checked) to directly record speechSynthesis.speak() audio output without using .getUserMedia().

@guest271314
Copy link
Owner

@technofreak1

So how can I make it record from speak() ?

If the option is available select

Monitor of Built-in Audio Analog Stereo

at OS system sound settings. That setting should provide the capability for MediaRecorder to record output of speak() from Chromium and Chrome as input listed as

Chrome input: RecordStream from Monitor of Built-in Audio Analog Stereo

without the device microphone output.

During audio output by speak() the Recording section of sound settings should display the live monitor of the stream.

Headphones can be plugged in to the device, without output to speakers or input to microphone and the audio output of speak() will still be recorded by MediaRecorder.

@guest271314
Copy link
Owner

@guest271314
Copy link
Owner

@technofreak1 See #17

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