Supergiovane / node-red-contrib-tts-ultimate

This node transforms a text into a speech audio. You can hear the voice natively through Sonos or external players.
MIT License
22 stars 5 forks source link

Feature request: configure audio sample rate #87

Open bs-eng opened 1 month ago

bs-eng commented 1 month ago

Hi Giovane!

Feature description A feature request regarding sample rate: When receiving audios from the TTS node using googleTTS, the audios come with a sample rate of 24'000 Hz. My devices receive audios (not only tts) from several sources and cannot switch between sample rates. Therefore it would be great to be able to set the sample rate either in the node or as input parameter.

On the google TTS REST API reference I found that it is generally possible: https://cloud.google.com/text-to-speech/docs/reference/rest/v1/AudioConfig

The parameter sampleRateHertz in the AudioConfig needs to be set for this. The AudioConfig ist part of the request body according to: https://cloud.google.com/text-to-speech/docs/reference/rest/v1/text/synthesize

Expected behavior Either a field in the node setup called 'sample rate' or a parameter in a msg would be great. Though I think a setting in the node would suffice.

TTS-Ultimate Version 2.0.7

Are you running node-red behind homematic, docker or anything similar? standalone on small linux server

Thanks for considering! Cheers JR