aedocw / epub2tts-edge

epub2tts-edge uses Microsoft Edge cloud-based TTS to create a full featured audiobook m4b from an epub or text file
GNU General Public License v3.0
95 stars 14 forks source link

Ability to save audio with higher quality than 32 kb/s mp3 #1

Closed danielw97 closed 7 months ago

danielw97 commented 7 months ago

Hi Aedocw, Thanks for your work on this project, it looks promising from a first look. Having the ability to generate tts offline is a big plus which is why I'm extremely grateful for the original utility, although this looks great as well. This might just be me as someone who works in the audio field, although I don't suppose there is a way to get output in a format better than mp3 at 32 kb/s for the tempfiles? This might be a limitation of the library you're using to interface with edge tts, although I believe what's then happening is that during the export you're basically transcoding an already low bitrate file which causes a loss in quality as it's being reencoded twice essentially. The nice thing about the wav and flac output from the previous utility is that these formats are both lossless, and can then be transcoded into whatever format you need without having to reencode twice if that makes sense. Let me know if there's any more info I can provide on this. My python isn't the greatest yet, although I'm going to have a look into the code on this as well. As always thanks for your continued work in this space, and at the end of the day this is only an idea so not a big priority.

Edit: this also seems to cause some slight artifacts due to the re-encoding of a lossy file.

aedocw commented 7 months ago

Unfortunately it's the best we can get back from edge-tts. See https://github.com/rany2/edge-tts/issues?q=is%3Aissue+bitrate