0

I am looking for a program that can, given an audio file containing the recording of someone's speech, split the audio file whenever the speaker pauses for some duration (ideally configurable).

I would prefer if the program could:

  • batch process many audio files.
  • split the audio file at the end of each sentence (instead of splitting whenever the speaker pauses for X seconds).

Any license, price, and operating system is fine.

  • 1
    For the long wait: the use case described is pretty close to digitizing music records, where the software needs to find the "gaps" to split the tracks. Perhaps such a software can be tricked to do the job for that "audio book on record"? GramoFile was such a software, but I'm not sure if it's still maintained. – Izzy Dec 9 '17 at 8:36
  • @Izzy thanks, interesting idea – Franck Dernoncourt Dec 9 '17 at 8:38
  • As is Steve's! If you thought mine "adventorous", his did really surprise me – absolutely reasonable, but who had thought of that! :) – Izzy Dec 9 '17 at 8:40
  • 1
    @Izzy yes. Another idea I'll explore soon: github.com/jiaaro/pydub – Franck Dernoncourt Dec 9 '17 at 8:42
  • Doesn't mention detection methods on its main page – but sounds very interesting indeed! – Izzy Dec 9 '17 at 8:45
2

I would suggest using MoviePy and a variation of this 30 lines of code which does the reverse for video files, (detecting high levels of sound to extract and splice video files to get the highlights of football/soccer matches).

The changes necessary would be to:

  • use AudioFileClip rather than VideoFileClip.
  • Look for pauses, (lows), rather than peaks in the sound levels.
  • Split from the end of the pause to the start of the next rather than from just before the start to just after the end of the high.
  • Save each split to a different filename rather than concatenating.
  • Add a threshold for the lengths of the pauses.

This solution uses:

  1. Python Needs to be installed first
  2. MoviePy - Installed with pip install MoviePy this also installs the following python libraries, if missing:
    1. Numpy - Windows users may need to manually download and installed from here.
    2. decorator
    3. imageio
    4. Pillow
    5. olefile (Windows only requirement for Pillow)
    6. tqdm
  3. FFMPEG - Automatically installed by MoviePy on first run if not found.

All of the items mentioned above are:

  • Free, Gratis & Open Source
  • Cross Platform (with the exception of olefile which is not required on non-Windows machines)
  • Permissively licenced.
  • Compact (the downloads for the above, in order & on my machine, are 30 MB, 18 MB (including dependencies) & 48 MB)

To actually detect sentence ending rather than pauses would require a much more complex approach involving speech to text conversion, natural language parsing, etc. but if you were using video with subtitles as an input you could simply detect the full stops in the subtitle file to get the timestamps and extract the audio between those timestamps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.