p0n1 / epub_to_audiobook

EPUB to audiobook converter, optimized for Audiobookshelf
MIT License
894 stars 87 forks source link

[Feature Request] Support for Customizable Audio Formats #3

Closed 7enChan closed 9 months ago

7enChan commented 9 months ago

Great project, thank you. Here’s a suggestion: Currently, the default output audio format is an mp3 with a bitrate of 48kbps, which has a relatively poor sound quality. It would be great if you could add support for other audio formats, allowing users to customize it using the parameter “X-Microsoft-OutputFormat”. Thank you once again.

p0n1 commented 9 months ago

You're welcome. I haven’t noticed that the audio quality of the audiobooks I converted is poor. I am very interested in trying other options and comparing their differences. I will implement this optional feature later. Thanks for the suggestion.

p0n1 commented 9 months ago

I just tried the ogg-24khz-16bit-mono-opus and ogg-48khz-16bit-mono-opus setting. I can hardly tell the difference to the default audio-24khz-48kbitrate-mono-mp3 for the audiobook. Do you have any preference on the settings from the list? I'd love to hear and learn your experience.

And I found we have to deal with filename extensions when enabling custom audio formats or just let user pass in.

https://github.com/p0n1/epub_to_audiobook/blob/f370bf7c978f6c8a60fb6e3e4062c6b782f81bd3/epub_to_audiobook.py#L203

And we have to deal with tags for other audio formats.

https://github.com/p0n1/epub_to_audiobook/blob/f370bf7c978f6c8a60fb6e3e4062c6b782f81bd3/epub_to_audiobook.py#L166-L172

7enChan commented 9 months ago

I just tried the ogg-24khz-16bit-mono-opus and ogg-48khz-16bit-mono-opus setting. I can hardly tell the difference to the default audio-24khz-48kbitrate-mono-mp3 for the audiobook. Do you have any preference on the settings from the list? I'd love to hear and learn your experience.

And I found we have to deal with filename extensions when enabling custom audio formats or just let user pass in.

https://github.com/p0n1/epub_to_audiobook/blob/f370bf7c978f6c8a60fb6e3e4062c6b782f81bd3/epub_to_audiobook.py#L203

And we have to deal with tags for other audio formats.

https://github.com/p0n1/epub_to_audiobook/blob/f370bf7c978f6c8a60fb6e3e4062c6b782f81bd3/epub_to_audiobook.py#L166-L172

Thank you for your reply. I previously used a TTS app that also utilized Azure TTS services, and I often use the audio-24khz-96kbitrate-mono-mp3 format. Honestly, I don't hear a significant difference compared to the current default of 48kbitrate. However, since I have a limited collection of audiobooks and ample disk space, and I also own a HiFi player 😄, I'd prefer to use a higher bitrate format. Nonetheless, if this would compromise the overall user experience, I'm okay with sticking to the current default format. It's already fantastic as it is, and I appreciate your efforts 🙏.


p0n1 commented 9 months ago

Hi @7enChan. I just released a new version and now you can choose more audio formats now.

Check the usage section here for details https://github.com/p0n1/epub_to_audiobook/tree/main#usage. Only MP3 format supported now because I don't want to deal with other formats currently.

I think I can tell the difference on audio quality now if I just choose the audio-48khz-192kbitrate-mono-mp3 config which is the highest and best. But the file size is large though. LOL. 😊