views:

92

answers:

2

Hello, I need to go through an audio stream of 30 minutes and look for another 30 seconds of audio which is within the first audio. Example: I have a file of 30 seconds and file 2, the recorded broadcast (30 mins.) And i want to find the start position of file 1 in file 2. Understand? Excuse my English.

Any help will be important Thanks

+2  A: 

I think the answer depends on the source of the longer audio stream. If the longer stream contains the exact image of the shorter one (for example, if it was created by an audio editor with access to the original) then you have a simple string search problem and many answers exist, like Boyer-Moore.

If however, the original was decoded and re-encoded (i.e: you are testing to see if some guy used part of your band's mp3 in his youtube video), then you've got a much more difficult problem.

I'd probably try to solve it in the frequency domain - Generate a 'signature' of the file 1 based on a sequence of smallish FFT windows, then doing a best-fit against FFTs from file 2. I have no idea how well this would work.

AShelly
If the latter, an acoustic fingerprinting library might be an option. Here's an open source one: http://code.google.com/p/libfooid/.
Caleb
I use Dephi 2010 and this library (libfooid) is in C++
pleonardomv
A: 

I work at a radio station. Radio is recorded 24 hours per day in blocks of 30 minutes each. I want to look for a 30-second commercial that was played in the programming of Radio. I use the BASS library to write. My idea is to cut an audio sample of 30 seconds and go through the blocks of 30 minutes looking for similarities audio of 30 seconds (commercial) I really need it

Thanks

pleonardomv
This probably corresponds to the first case in AShelly's answer.
MAK
Yes would be the first case...
pleonardomv
In that case, a basic string search should work, just treat the PCM like a character stream. Just make sure to allow `0`s - don't treat them as terminators.
AShelly