-2

I have audio recordings that starts and ends at different times.

audio 1: -----t1--------------------------s1->time
audio 2: ---------t2----s2------------------->time
audio 3: ------------------------t3-------s3->time

audio 1 is the longest and it overlaps with both audio 2 and 3. audio 2, and audio 3 are short segments but they do not overlap at all. Is there a python library that does this?

MAS
  • 2,665
  • 7
  • 26
  • 49
  • What do you mean by start and end ? Do you want to read the audio files from a point that is nit the beginning? – PatriceG Jul 13 '16 at 09:12
  • those are recordings of the same event, some started before others. some ended earlier. so its kind of finding the offsets. @sandoval31 – MAS Jul 13 '16 at 10:08

1 Answers1

0

You could first use a python library to read the audio file (numpy or scipy for instance, see https://stackoverflow.com/a/26716031/3244382).

Then you have to determine t and s for each file. If the files are not too noisy a simple threshold on the audio signal could be sufficient. A little bit more sophisticated approach would be to compute the RMS energy or the envelope (that average the signal), and use a threshold on it.

Once you know s and t, you could write a new audio file from this boundaries with the same audio library.

Community
  • 1
  • 1
PatriceG
  • 3,270
  • 5
  • 23
  • 43