Closed josephsctan closed 3 years ago
@glharper Could you please look at this.
@josephsctan Thanks for writing up this issue and using Speech SDK. Microphone input for Speaker Identification/Verification is currently not supported for JavaScript. We've added this to our backlog, and we will prioritize this against all future work.
Describe the bug Using Speaker Identification in JS with Mic input not working.
To Reproduce Steps to reproduce the behavior:
Create Profile and Enroll Speakers (see here )
Add this code
// this will work async IdentifySpeakers(profile, speech_config, url) { const audio_config = await this.GetAudioConfigFromURL(url); const model = window.SpeechSDK.SpeakerIdentificationModel.fromProfiles([profile]); const recognizer = new window.SpeechSDK.SpeakerRecognizer(speech_config, audio_config);
// this will Not async IdentifySpeakerFromMic(profile, speech_config) { const audio_config = window.SpeechSDK.AudioConfig.fromDefaultMicrophoneInput(); const model = window.SpeechSDK.SpeakerIdentificationModel.fromProfiles([profile]); const recognizer = new window.SpeechSDK.SpeakerRecognizer(speech_config, audio_config);
// ---------------------------------------------------------------- // NOTE: recognizer.recognizeOnceAsync throws this error: "SyntaxError: Unexpected token N in JSON at position 0" // ----------------------------------------------------------------
public static async Task SpeakerIdentification(SpeechConfig config, List voiceProfiles, Dictionary<string, string> profileMapping)
{
var speakerRecognizer = new SpeakerRecognizer(config, AudioConfig.FromDefaultMicrophoneInput());
var model = SpeakerIdentificationModel.FromProfiles(voiceProfiles);
}
Identifying /assets/dev/unknown_jt2.wav... SpeakerId.js:166 The most similar voice profile is: 7ddcef4e-cc00-452a-9823-be58c067e80c with similarity score: 0.6940312.
SpeakerId.js:110 Identifying /assets/dev/unknown_jill.wav... SpeakerId.js:166 The most similar voice profile is: 00000000-0000-0000-0000-000000000000 with similarity score: 0.
SpeakerId.js:146 Speaker Identification Attempt: 2 SpeakerId.js:127 Error: SyntaxError: Unexpected token N in JSON at position 0