Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category Utils
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Release 3.6
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by ddalton - 2010-07-30
Last edited by funman - 2010-08-28

FS#11506 - Python script to generate .talk clips

I 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)

Closed by  funman
2010-08-28 11:00
Reason for closing:  Accepted
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

r27914

Hi,

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

Hi,

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!

I just noticed there is no license header in your script, can you add a GPL header if you want to distribute it under GPL?

Just copy the header from tools/thumb-cc.py for example and don’t forget to add your copyright

Sure, here it is.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing