|Perl Monk, Perl Meditation|
How to generate MP3 silence?by tlm (Prior)
|on Nov 27, 2007 at 03:53 UTC||Need Help??|
tlm has asked for the
wisdom of the Perl Monks concerning the following question:
My home coding project du jour is to make a collection of MP3 "sound flashcards" for foreign language learning drills. The "basic flashcard" consists of a bit of speech signal (the "challenge"), followed by a silence, followed by some more speech signal (the "answer").
As my starting material are a few hundred "challenge" MP3 files and the matching "answer" MP3 files. My mission is to generate individual MP3 files for each challenge-answer pair. I.e. I need to stitch together a challenge file and its corresponding answer file, and stick some silence in between.
My initial idea was to generate a small "spacer" silence file using Audacity (I generated 0.1 seconds of silence and exported it as MP3), and to use MPEG::Audio::Frame to stitch together the challenge file, an variable number of copies of the spacer file, as needed, and finally the answer file.
Well, no cigar. The resulting stitched up file plays OK in Audacity, but bombs in iTunes. For some reason, iTunes aborts the playback of the file in the middle of the silence between the challenge and the answer.
I observed a lot more weirdness with this than I want to bore you with. Suffice it to say that, despite what Audacity says, I have reasons to suspect that the silence I'm inserting between the challenge and the answer is not all that quiet.
So I'm back to square 1. Can someone suggest a better way to do all this? And more specifically, a better way generate some "MP3 silence" to use as a sound spacer? (FWIW, I'm using OS X Tiger.)
the lowliest monk