henrymaas / AudioSlicer

Audio Slicer that uses silence detection to split .wav audio files into multiple .wav samples.
291 stars 59 forks source link

Unable to specify split length #7

Closed cody151 closed 1 year ago

cody151 commented 1 year ago

Hi,

I'm trying to specify the length of time each segment should be but for some reason the audio is only being split into 3 second segments.

henrymaas commented 1 year ago

Hi,

I'm trying to specify the length of time each segment should be but for some reason the audio is only being split into 3 second segments.

Hello! I'm not entirely sure if I understood correctly. The algorithm does not allow you to explicitly set the length of the segments. Instead, it will attempt to identify periods of "silence" within your audio file and use those to split the file accordingly.

To help illustrate this, consider the image below: audo_processing

With the default values, it will split the file into three samples. This is because the algorithm found 3 periods of silence (clearly seen as a flat line). There are macro periods of silence on it, but because of the min_silence_lenght set to 0.6, it will ignore this small silence periods. Use it together with silence_threshold and step_duration to match your audio file and get better results.

If you need to cut your audio file into predetermined time periods, I would suggest using an audio software like Audacity to make manual edits. Please don't hesitate to ask me any questions.