Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Dear Monks,

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


In reply to How to generate MP3 silence? by tlm

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-23 10:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found