soimort / translate-shell

:speech_balloon: Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc.
https://www.soimort.org/translate-shell
The Unlicense
6.94k stars 391 forks source link

Need help formatting the filenames of downloaded audio #449

Open Ao1Pointblank opened 2 years ago

Ao1Pointblank commented 2 years ago

using the -download-audio-as option, how can i set the file name to match this format: [target language abbreviation] - [word or phrase].mp3

it may also be helpful to other people to know how to add in the engine used, and narrator voice.

i tried figuring this out myself, and found output = text " [" Option["engine"] "] (" Option["narrator"] ").ts" on line 269 of Translate.awk https://github.com/soimort/translate-shell/blob/1e3f901c479fc4f838b290f11e1b547b86bdadd4/include/Translate.awk#L263-L275

unfortunately i'm not smart enough to figure out how to use this information myself, but i'll keep messing around.

Ao1Pointblank commented 2 years ago

for now, i simply edited /usr/bin/trans, line 3199, to be output = text".mp3"

Ao1Pointblank commented 1 year ago

for now, i simply edited /usr/bin/trans, line 3199, to be output = text".mp3"

unfortunately this workaround no longer works. renaming the files manually works. i can't use the play command on a .ts file which is what i want to do with these files.