Interview to Speech
Interview to Speech is a delightful Perl script that uses the tools say, LAME and mp3cat from the Perl module mp3cut together with a formatted interview to produce a spoken word MP3 file where the questions and answers are read in order with different voices.
The script is provided via the BSD license and is open for patches. Questions? Contact wootest+inttosp {at} gmail.com.
To download the script, skip to the bottom of the page, but if you want it to actually work, you'll need to read the instructions between here and the download link carefully!
Could I use this?
You'll need to have a clue how to install Perl modules and the "LAME" software to be able to configure your Mac to use this script. A general sense of how to use *nix-style commands, pipes and Perl are preferable. If you don't know how to do these things, try to get someone that does know these things to help you, or turn back at once. This is more of a *nix hack than a Mac application - don't expect the latter.
What does this script require?
Why isn't other *nix platforms than Mac OS X supported?
The script is mostly platform-agnostic, but it relies on the say command in Darwin/Mac OS X to produce the speech. It could probably easily be altered to work with similar tools (like Festival), but doing so is left as an exercise for the reader (who may submit patches, though).
May I have some extremely rough instructions?
Yes. (These instructions are written for Mac OS X users, although most *nix users that has a shot at being able to use the script should find no trouble in adapting the steps for their own particular platform.)
- Use Fink or DarwinPorts to grab LAME, or try to find a decent LAME binary. (The reason I'm not linking to any binaries is because better ones might emerge or existing ones might disappear or grow unmaintained.)
- Use CPAN (sudo perl -MCPAN -eshell) to grab and install mp3cut with prerequisites.
- Find (or assemble) the interview:
- Use the following format:
<h3>Question</h3>Answer
Repeat for the number of question-answer pairs necessary. Feel free to include extra newlines and stuff if needed - what's important is that the question part is wrapped in a <h3> tag pair. - Those using HTML: Other tags will be stripped. Entities will be decoded. Take this in consideration.
- Use a command like this: cat filewithinterview | perl nameofscript.pl to run the script; piping the input into STDIN is key.
Known bugs, quirks or common fuck-ups
- Perl's Unicode support, to me, is confusing at best. say may croak at unusual characters, which, it turns out, may include curly quotes. The conversion from UTF8 to ISO 8859-1 is a shot at working around this, but I mainly have no clue in the devily details that must surround this. Sigh.
- The script, when run, absolutely positively must have write access to the current directory.
- The script creates intermediate files that start with interv, _, q or a in the process. These files are not cleaned up after run because you may want to investigate faulty behavior (see quirk one above), BUT they are however removed at the next run, with the sole exception of the interview-mastered.mp3 file which gets backed up to the old.interview.mp3 file (but overwritten again next time).
- The script uses a lot of direct system calls to move around files. My Perl needs to be dusted off, but in the meantime these system calls are great and work.
- Did I mention my Perl needs to be dusted off? Remove your neatness goggles if you're going to do anything beyond using the script - it's positively icky.
Does this have anything whatsoever to do with podcasting?
No, not beyond being able to produce audio suitable for inclusion in a podcast. The script doesn't produce podcast feeds for you and it doesn't produce chapter marks in the output file because it doesn't produce AAC files.
I'm loose with money and I happen to like your script! Can I donate?
Download the script.