Closed gv1006 closed 11 months ago
This item has been open without activity for 19 days. Provide a comment on status and remove "update needed" label.
@gv1006 Thank you for using JS Speech SDK, and writing this issue up. In the sample code above, the method closePlayer does not seem to be defined. Are you seeing this issue when closePlayer is properly defined?
This item has been open without activity for 19 days. Provide a comment on status and remove "update needed" label.
There hasn't been any activity on this item for quite some time after @glharper's question. Closing. If the problem persists, please let us know and either reopen this issue or create a new one.
Describe the bug OnAudioEnd callback working is not consistent. After text to speech audio is completed, sometimes we're not getting any onAudioEnd callbacks and sometimes we're getting lot of callbacks. Details:
To Reproduce Steps to reproduce the behavior:
Expected behavior After text to speech audio is completed, we expect only one onPlayerAudioEnd callback.
Actual behaviour Sometimes we're getting only one callback Sometimes we're not getting callbacks at all Sometimes it's getting crashed and we're getting lot of callbacks.
Version of the Cognitive Services Speech SDK 1.30
Platform, Operating System, and Programming Language
Additional context
Code ` const onPlayerAudioStart = function () { console.log('Audio started'); };
const onPlayerAudioEnd = function () { console.log('Audio ended'); closePlayer(); };
export const stopAudioTalkBalk = function () { if (player) { player.pause(); closePlayer(); } };
export const handleTextToSpeech = async (text: string, language: string) => { try { stopAudioTalkBalk(); const { authToken, error, region } = await getTokenOrRefresh(); if (error || !authToken || !region) { console.log('something went wrong when fetching token'); return; } const speechConfig = speechsdk.SpeechConfig.fromAuthorizationToken( authToken, region, ); let speechSynthesisVoiceName = 'en-IN-NeerjaNeural'; const speakerGender = 'fe'; if (language && languageSpeechMapping[language]) { speechSynthesisVoiceName = languageSpeechMapping[language][speakerGender]; }
} catch (e) { console.log(
An error occurred: ${e}
); } }; ` Please observe in the following image, we have audio started callback and we don't have audio ended callbacks.In the following image, we haven't faced any issue and we have both audio started and audio ended callbacks.