|Don't ask to ask, just ask|
Cut exact time range from compressed audioby Sixtease (Friar)
|on Apr 07, 2012 at 19:03 UTC||Need Help??|
Sixtease has asked for the
wisdom of the Perl Monks concerning the following question:
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";