I have audio files and timestamped fragment transcriptions that I have force-aligned with third party software.
Unfortunately the software places the end of each fragment right before the start of the next fragment, so if you try to play just one fragment from the audio file it will bleed over to the next fragment.
Here's a visualization of the waveform:
The red line is the automatically produced timestamp for the end of one fragment, and the start of another. The left and right sides are 2 seconds of audio on either end of that timestamp. As you can see it's placed right up against the next time audio starts to output.
The blue and purple lines are two different algorithms I've used to try to identify the middle of the trough. In this case, the blue one worked, but in others it doesn't:
The data is a list of floating point numbers ranging from 0 to 1. They represent a normalized and bucketed version of decoded 48Hz mp3 audio. As you can see, in some cases there's a range of near zero values. In others there's varying degrees of "low volume", but always a visually-identifiable trough.
Can anyone recommend a method or algorithm for working backwards from the red line and finding the middle of the first trough? TIA!