from pydub import AudioSegment
from pydub.silence import split_on_silence
from pydub import silence
from pydub.playback import play
sound = AudioSegment.from_file("prec.wav", format="wav")
#chunks = split_on_silence(sound, min_silence_len=1000, silence_thresh=-16,seek_step=1, keep_silence=100)
chunks = split_on_silence(sound, min_silence_len=2000, silence_thresh=-40, keep_silence=600)
for i, chunk in enumerate(chunks):
chunk.export("dat/"+"output" + str(i) +".wav", format="wav")
play(chunk)
print(silence.detect_nonsilent(sound, min_silence_len=1000, silence_thresh=-16,seek_step=1))
ディスカッション
コメント一覧
まだ、コメントがありません