Share via

How to track the progress of a enrollProfileAsync call in the microsoft-cognitiveservices-speech-sdk

Suman Bhagavathula 0 Reputation points
2024-04-03T22:00:43.5666667+00:00

I have Speech Recognition service approved and enabled for my scenario. I am trying to create a profile and enroll using a audio file. The first step (profile creation) completed, but the enrollProfileAsync seems to take forever for a 5 min audio file. Is there a way to track the progress and estimate completion time? I am using the below code snippet and getting stuck on penultimate line (enrollProfileAsync call). Any help is appreciated.

const enrollFile = "myEnrollFile.wav"; // 16000 Hz, Mono

// now create the speech config with the credentials for the subscription
const speechConfig = sdk.SpeechConfig.fromSubscription(subscriptionKey, serviceRegion);
const client = new sdk.VoiceProfileClient(speechConfig);
const locale = "en-us";

const profile = await client.createProfileAsync(sdk.VoiceProfileType.TextIndependentIdentification, locale);
const audioConfig = sdk.AudioConfig.fromWavFileInput(fs.readFileSync(enrollFile));

console.log("Profile id: " + profile.profileId +" created, now enrolling using file: " + enrollFile);
const enrollResult = await client.enrollProfileAsync(profile, audioConfig);

console.log("(Enrollment result) Reason: " + sdk.ResultReason[enrollResult.reason]);
Azure AI Speech
Azure AI Speech

An Azure service that integrates speech processing into apps and services.


Your answer

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