google TTS neural voice for txt to mp3

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
crypter
Posts: 90
Joined: 15 Dec 2020, 09:57

google TTS neural voice for txt to mp3

Post by crypter » 19 Dec 2022, 17:59

i want to try and create a script that works with googe text to speech. it has to save txt files as mp3 files
Screenshot_10.png
Screenshot_10.png (82.92 KiB) Viewed 731 times
i have a folder of txt files that i want to save as mp3 through google TTS web service

it has to process al the text files and save as mp3

if google TTS doesnt work we have microsoft azure TTS


https://azure.microsoft.com/en-us/products/cognitive-services/text-to-speech/
https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/get-started-text-to-speech?pivots=programming-language-csharp
Last edited by crypter on 20 Dec 2022, 07:22, edited 1 time in total.
crypter
Posts: 90
Joined: 15 Dec 2020, 09:57

Re: google TTS neural voice for txt to mp3

Post by crypter » 20 Dec 2022, 14:44

it can use microsoft azure TTS because it doesnt have a capcha

plz help me, i depend on this
garry
Posts: 3795
Joined: 22 Dec 2013, 12:50

Re: google TTS neural voice for txt to mp3

Post by garry » 20 Dec 2022, 16:11

an example

Code: Select all

;============================================================
e1=
(
How are you ?
Nice weather today .
I'll see you tomorrow .
)
TL:="English"
;TL:="German"
spVoice:=ComObjCreate("SAPI.SpVoice")
stream :=ComObjCreate("SAPI.SpFileStream")
voices :=spVoice.GetVoices()
voiceSet=0
name:=a_desktop . "\" . a_now . "_example.wav"
for voice in voices {
	description:=voice.GetDescription
	if (InStr(description,TL)) {
		spVoice.voice:=voice
		voiceSet=1
		break
	}
}
return
;---------
$F9::
if (voiceSet) 
   {
   	stream.open(name, 3) 
	spvoice.AudioOutputStream := stream
	spVoice.Speak(e1)
	sleep,300
	stream.close()
    } 
else 
  MsgBox No %TL% TTS support.
try  
  run,%name%
return
;=========================================================

malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: google TTS neural voice for txt to mp3

Post by malcev » 20 Dec 2022, 23:29

plz help me, i depend on this
If You really depend on "azure text to speech" without paid subscription then You need to understand how this algorithm works on python and then convert it to ahk.
https://github.com/OS984/DiscordBotBackend/blob/main/NeuralTTS.py
crypter
Posts: 90
Joined: 15 Dec 2020, 09:57

Re: google TTS neural voice for txt to mp3

Post by crypter » 21 Dec 2022, 20:08

we should gather some professional AHK programmers to create this. it`s very useful.

also, azure TTS has a character limit, and google TTS has a capcha check
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: google TTS neural voice for txt to mp3

Post by malcev » 21 Dec 2022, 20:42

If You ask this question about 2 years ago, I would try to transfer it, because it was interesting for me to investigate and translate python code.
But now I am too lazy for such a task.
On Your place I would try to start learning python and use it for this task instead of ahk.
BTW here is cli
https://github.com/skygongque/tts/tree/main/python_cli_demo
Post Reply

Return to “Ask for Help (v1)”