How to stop Azure Text to Speech audio on Python

Jim 0 Reputation points
2023-05-11T10:21:39.0833333+00:00

Hello,

I am trying to build an app on Python but i have a problem with audio everytime i press play the audio is played, i tried to make something like only generate the output file without hearing the audio but is not working.

So what iam looking is , Add a text , and then Generate the output audio , but the audio should not be heard inside the App but only when you open the output audio.

Thanks

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,602 questions
{count} votes

1 answer

Sort by: Most helpful
  1. VasaviLankipalle-MSFT 18,676 Reputation points Moderator
    2023-05-11T23:19:29.65+00:00

    Hi @Jim , Thanks for using Microsoft Q&A Platform.

    The SpeechSynthesizer class can be used to execute text-to-speech conversions and output the results to speakers, files, or other output streams. To specify how the output results should be handled, you can create an AudioOutputConfig instance with the filename parameter set to the path where you want to save the output file.

    Based on your use I believe you can make use of this class.

    I would request you to refer to this documentation to know more about this speech synthesizer: https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/how-to-speech-synthesis?pivots=programming-language-python&tabs=browserjs%2Cterminal#synthesize-speech-to-a-file

    I hope this helps.

    Please let me know if you if you are looking for more information.

    Regards,
    Vasavi

    -Please kindly accept the answer and vote 'yes' if you feel helpful to support the community, thanks.

    0 comments No comments

Your answer

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