Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected audioOffset Value for bookmarkReached Event in SSML with Break Times #26311

Open
1 task done
aamoronatti opened this issue Jun 23, 2023 · 2 comments
Open
1 task done
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Cognitive - Speech customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service Attention Workflow: This issue is responsible by Azure service team. Service This issue points to a problem in the service.

Comments

@aamoronatti
Copy link

  • Package Name: microsoft-cognitiveservices-speech-sdk
  • Package Version: 1.29.0
  • Operating system: Any
  • nodejs
    • version: 18

Describe the bug

Bookmarks that are preceded by break times in SSML don't seem to work as expected when using the speakSsmlAsync method of the SpeechSynthesizer object. The audioOffset property in the bookmarkReached event seems to be misaligned.

To Reproduce

Steps to reproduce the behavior:

  1. Create a SpeechSynthesizer object.
  2. Subscribe to the bookmarkReached event.
  3. Use speakSsmlAsync to synthesize an SSML string that includes bookmarks preceded by break times.
  4. Observe that the audioOffset property of the bookmarkReached event data does not reflect the correct position.

Code

const sdk = require("microsoft-cognitiveservices-speech-sdk");

const subscriptionKey = "*";
const serviceRegion = "northeurope";
const config = sdk.SpeechConfig.fromSubscription(subscriptionKey, serviceRegion);

config.setProperty(sdk.PropertyId.SpeechServiceResponse_RequestSentenceBoundary, 'true');

const audioConfig = sdk.AudioConfig.fromDefaultSpeakerOutput();

const synthesizer = new sdk.SpeechSynthesizer(config, audioConfig);

synthesizer.bookmarkReached = function (s, e) {
    var str = `BookmarkReached event: \
            \r\n\tAudioOffset: ${(e.audioOffset + 5000) / 10000}ms \
            \r\n\tText: \"${e.text}\".`;
    console.log(str);
};

const speech_synthesis_voice_name = 'es-ES-AlvaroNeural';

const ssml = `<speak version='1.0' xml:lang='en-US' xmlns='http://www.w3.org/2001/10/synthesis' xmlns:mstts='http://www.w3.org/2001/mstts'>
    <voice name='${speech_synthesis_voice_name}'>
        Hola! <break time="5s"></break> <bookmark mark='1'/>Posicion de este mark.<bookmark mark='2'/>.
    </voice>
</speak>`;

console.log("SSML to synthesize: \r\n" + ssml);

synthesizer.speakSsmlAsync(
    ssml,
    result => {
        if (result) {
            console.log(JSON.stringify(result));
        }
        synthesizer.close();
    },
    error => {
        console.log(error);
        synthesizer.close();
    });

Expected behavior

BookmarkReached event:             
	AudioOffset: 5575.5ms             
	Text: "1".
BookmarkReached event:             
	AudioOffset: 7725.5ms             
	Text: "2".

Actual behavior

BookmarkReached event:             
	AudioOffset: 575.5ms             
	Text: "1".
BookmarkReached event:             
	AudioOffset: 7725.5ms             
	Text: "2".
@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jun 23, 2023
@github-actions github-actions bot removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jun 23, 2023
@xirzec xirzec added Service Attention Workflow: This issue is responsible by Azure service team. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. Service This issue points to a problem in the service. bug This issue requires a change to an existing behavior in the product in order to be resolved. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Jun 23, 2023
@github-actions
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @robch @oscholz.

@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Jun 23, 2023
@aamoronatti
Copy link
Author

Any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Cognitive - Speech customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service Attention Workflow: This issue is responsible by Azure service team. Service This issue points to a problem in the service.
Projects
None yet
Development

No branches or pull requests

2 participants