This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#11506 - Python script to generate .talk clips
Attached to Project:
Rockbox
Opened by Daniel Dalton (ddalton) - Friday, 30 July 2010, 09:47 GMT+2
Last edited by Rafaël Carré (funman) - Saturday, 28 August 2010, 13:00 GMT+2
Opened by Daniel Dalton (ddalton) - Friday, 30 July 2010, 09:47 GMT+2
Last edited by Rafaël Carré (funman) - Saturday, 28 August 2010, 13:00 GMT+2
|
DetailsI felt the need for a quick, easy and reliable way to generate .talk
clips from the Linux console. I'm totally blind, and rbutil was not an option as QT apps aren't accessible under Linux. I decided to develop a script in python to do just this. It works reasonably well, though it is basic, but it does what I want. This patch creates the file trunk/tools/talkclips.py python talkclips.py will give usage info, though all you do is supply one argument, the directory you wish to create talk clips under. Features: Creates clips for files and directories (recursively) Logs to a file so usage can be examined. Validation checks for the command line as well as error checking. Maybe it might be handy to add functionality so a file can be passed, but I couldn't see why someone would want this...? A progress measurement may be useful, but I think this just over complicates the whole thing. Requirements should just be python, espeak, and rbspeexenc should be in the same dir unless you modify the path in my script. You obviously need some kind of shell to work with os.system(), eg. bash. Anyway let me know your thoughts (diff attached) |
This task depends upon
Closed by Rafaël Carré (funman)
Saturday, 28 August 2010, 13:00 GMT+2
Reason for closing: Accepted
Additional comments about closing: r27914
Saturday, 28 August 2010, 13:00 GMT+2
Reason for closing: Accepted
Additional comments about closing: r27914
I don't use talk clips but just a small comment:
Could you detect espeak/rbspeexenc before running these programs, and fail if they are not accessible?
For example try to run "which espeak", or "espeak -h > /dev/null"
If you prefer I can commit the script as is and you could make another patch later
Thanks for the feedback. Attached is a revised version:
1. Set a full path for espeak and check if it exists (using
os.path.exists())
2. I've done the same for rbspeexenc default path for rbspeexenc is
still in the current working dir (./)
3. Print an error, and abort if rbspeexenc or espeak can't be found.
4. Moved some variables which should be changed by the user if desired
to the top of the file and
added clearer comments. Also noted what shouldn't be touched and moved
this down the file out of the way.
5. Checked that all expected functionality works
I think this is ready to be committed, so I'd be very grateful if you
would commit.:)
Thanks!
Just copy the header from tools/thumb-cc.py for example and don't forget to add your copyright