How to create an audioStream from the capture returned by tabCapture from google api in a chrome extension

Krinskumar Vaghasia 0 Reputation points
2023-06-15T13:55:14.1733333+00:00

I am trying to create a audioStream to instantiate an AudioConfig object using the fromStreamInput method, Heres is how the capture looks like:

chrome.tabCapture.capture({audio: true},  function(stream) {

	const speechConfig = SpeechConfigG.fromSubscription(SPEECH_KEY, SPEECH_REGION);
    speechConfig.speechRecognitionLanguage = 'en-US';
	
    const output = new AudioContext();
	const source = output.createMediaStreamSource(stream);
    audioStream = ???	// convert the source or the output or the stream into the audioStream object

	const recognizer = new SpeechRecognizer(speechConfig, audioConfig);
    
});
Community Center | Not monitored
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.