I'm trying to make a TTS script work using remote AI service (because of the high quality), all done with only AHK (send a string, get back a .wav). For now i will use Google, Microsoft Azure or Amazon Polly as they all have free limits per month and great quality. All of them have good documentation for traditional languages, especially the one from Microsoft.
On Microsoft website there is how to make it work for some languages including C (I read somewhere that AHK has a type of C converter), so the question is: Just looking at this code, is possible to adapt the C code below for AHK? Maybe the REST via GET is easier? For now i just want to know it and ill search and work on it to make it work soon or later. Fell free to help more if you can, i will be grateful.
The end objective is simple: (Send a string and get back a .wav, all with ahk.)
C
Code: Select all
public class Program
{
static async Task Main()
{
await SynthesizeAudioAsync();
}
static async Task SynthesizeAudioAsync()
{
var config = SpeechConfig.FromSubscription("YourSubscriptionKey", "YourServiceRegion");
using var audioConfig = AudioConfig.FromWavFileOutput("path/to/write/file.wav");
using var synthesizer = new SpeechSynthesizer(config, audioConfig);
await synthesizer.SpeakTextAsync("A simple test to write to a file.");
}
}
Code: Select all
curl --location --request POST 'https INSERT_REGION_HERE.tts.speech.microsoft.com /cognitiveservices/v1' Broken Link for safety \
--header 'Ocp-Apim-Subscription-Key: INSERT_SUBSCRIPTION_KEY_HERE' \
--header 'Content-Type: application/ssml+xml' \
--header 'X-Microsoft-OutputFormat: audio-16khz-128kbitrate-mono-mp3' \
--header 'User-Agent: curl' \
--data-raw '<speak version='\''1.0'\'' xml:lang='\''en-US'\''>
<voice xml:lang='\''en-US'\'' xml:gender='\''Female'\'' name='\''en-US-AriaRUS'\''>
my voice is my passport verify me
</voice>
</speak>' > output.wav
Thanks!