Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A graphical UI perhaps #6

Open
sejbk opened this issue Apr 24, 2024 · 5 comments
Open

A graphical UI perhaps #6

sejbk opened this issue Apr 24, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@sejbk
Copy link

sejbk commented Apr 24, 2024

Thanks for creating the nice little tool.

As part of a little quest to learn to code Python I came across your package and used that as a basis for an UI app built with ttkbootstrap. Still have a little issue with generating a m4b file with good sound quality but as an interim solution I'm just creating MP3 files and that sounds good.

I'm certainly not a great Python programmer but let me know if you wish for me to share the code with you.

image
@aedocw
Copy link
Owner

aedocw commented Apr 24, 2024

This looks amazing! I'd love to incorporate this some way, or else feel free to put it up on github and I can point folks to your repo if they want a version with UI.

I am definitely not a great python programmer, haha! I haven't had time to look at this lately, but I think the fix for the audio is going to be in using pydub better than I'm using it now. Like pull in each mp3 as an object, combine them with the blank audio for each paragraph break, and do a single export per chapter as flac files. Then at the end, probably find some flags for ffmpeg to no try to do any compression on the file. Hopefully I'll have time in the next few weeks to do that.

@aedocw aedocw added the enhancement New feature or request label Apr 24, 2024
@aedocw
Copy link
Owner

aedocw commented May 16, 2024

@sejbk Hello, any chance you've had an opportunity to think about this? I love the UI you made, it looks really great, would be really fun to try adding it :)

@sejbk
Copy link
Author

sejbk commented May 17, 2024

Hi,

Here you go - haven't had time to put more effort into this but feel free to use whatever part of the code you think might be useful.

The idea is that it works in smaller steps compared to the command line tool.

Note, it will assume that there is a file called artwork.jpg in the same folder as the input file that will be used for the graphics.

  1. Convert EPUB to TXT
  2. Now you can do whatever changes you wish to do in the TXT file
  3. Convert TXT to JSON
  4. Now you can edit the album name etc if you wish and the JSON file have the structure of the chapters and sentences.
  5. Convert JSON to MP3 Each chapter will be created as a MP3 file with ID3 tags set with title, album, artist, track number, total tracks and artwork etc.
  6. (Not yet complete) create M4B out of the MP3 files.

Known issues / TODOs

  • The point of this was that I wanted to learn how to create a Python UI app with ttkbootstrap so there is no guarantee anything works as you would expect.
  • There is a limitation in how fast you can get a single threaded UI as I understand to refresh fast enough running long tasks. This could perhaps be done in more efficient way.
  • I haven't been able to get the MP3 to M4B to work the way I wanted, leaving that to someone else to figure out how to do with a good audio quality result.
  • Should probably spend more time thinking about the work flow when certain buttons should be enabled or not etc
  • Code not really documented or cleaned up for real use

Have fun!

UI_project.zip

@sejbk
Copy link
Author

sejbk commented May 17, 2024

I have noticed that for large volumes of text the EDGE service seemingly randomly returns a small number of the spoken sentences with another voice and or language, no idea why that is.

@aedocw
Copy link
Owner

aedocw commented May 17, 2024

Awesome, thank you for sharing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants