pndurette / gTTS

Python library and CLI tool to interface with Google Translate's text-to-speech API
http://gtts.readthedocs.org/
MIT License
2.26k stars 361 forks source link

SD106 appears to mean South Dakota 106 #470

Closed dermotgouk closed 1 month ago

dermotgouk commented 3 months ago

Prerequisites

Current Behaviour (steps to reproduce)

Related the the same issue I posted about " and feet. I am now getting the transcription of SD106 as South Dakota 106, but when I add some quotation marks it fixes itself. (https://github.com/pndurette/gTTS/issues/447#issue-2068459367)

                finished = (Space 4,SD106,Operational,Space 4)
                finishing =str(finished)
                print(finishing)
                var= gTTS(text = finishing,lang = 'en') 
                var.save('eng.mp3')

How it looks the way I have fixed it:

                finished = (Space 4, ", SD106, ",Operational,Space 4)
                finishing =str(finished)
                print(finishing)
                var= gTTS(text = finishing,lang = 'en') 
                var.save('eng.mp3')

Expected Behaviour

It should say:

es di one zero six

Context

Work around works but is not too clean

Environment

gTTS version: 2.5.1 Operating System version: Windows 11

pndurette commented 1 month ago

Sorry I'm late to this, but this is indeed the same issue as #447 and is the exact same fix. You're not converting your tuple properly so your string to read is full of extra punctuation, which yeah can have weird results.

See my comment, same thing: https://github.com/pndurette/gTTS/issues/447#issuecomment-1880105901