So, I am building a web application for transcribing speech. Mp3 and ogg/vorbis files reside in an external CDN. Each file is worth about 1 hour of playback. The recordings get automatically transcribed via means of ASR. The user listens to the audio and sees the transcription, which contains errors. The user selects a span of erroneously transcribed text, provides the correct transcription and this is sent to the server.

The server gets the filename of the audio, the timestamps of the start and end of the corrected passage, and the actual transcription.

Now the server does the forced alignment of the text to the audio, which means it must access the exact timespan of the audio file. And here comes the problem. The audio file is not on the server -- it is on a CDN. There's just too much data (~50GB) to store it on the web server.

So I thought I'd request just the needed part of the audio file via HTTP Range header but then you have a fragment of an mp3 or of an ogg and I don't know how to find out which exact time position in the whole file the cut part represents.

I tried using Audio::Mad and Ogg::Vorbis::Decoder but both failed to decode file fragments. I would be thankful for insights and advices. Not only how to decode the audio file fragments but also about other possible solutions.

use strict; use warnings; print "Just Another Perl Hacker\n";

In reply to Cut exact time range from compressed audio by Sixtease

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.