Skip to content

Commit

Permalink
Remove deviceId (#5403)
Browse files Browse the repository at this point in the history
Co-authored-by: Eugene <[email protected]>
  • Loading branch information
compulim and OEvgeny authored Jan 7, 2025
1 parent ad222dd commit cf2b542
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions samples/03.speech/i.initial-silence-timeout/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,8 @@
);
const { token } = await res.json();

// Select the audio input device which has the keyword "Audio" in it.
const { deviceId } = (await window.navigator.mediaDevices.enumerateDevices()).find(
({ label }) => ~label.indexOf('Audio')
);

// Create the ponyfill factory function, which can be called to create a concrete implementation of the ponyfill.
const webSpeechPonyfillFactory = await window.WebChat.createCognitiveServicesSpeechServicesPonyfillFactory({
audioInputDeviceId: deviceId,

// We are passing the Promise function to the "credentials" field.
// This function will be called every time the token is being used.
credentials: fetchSpeechServicesCredentials,
Expand Down

0 comments on commit cf2b542

Please sign in to comment.