Ejemplo n.º 1
0
Archivo: test.py Proyecto: mayite/aukit
def test_audio_editor():
    from aukit.audio_editor import split_silence_wave, strip_silence_wave, remove_silence_wave

    out_wav = strip_silence_wave(_wav, sr=_sr, keep_silence_len=2)
    assert len(out_wav) == 800
    out_wav = remove_silence_wave(_wav, sr=_sr, keep_silence_len=2)
    assert len(out_wav) == 800
    out_wavs = split_silence_wave(_wav, sr=_sr, keep_silence_len=2)
    assert len(out_wavs) == 1
Ejemplo n.º 2
0
def run_editor():
    import aukit
    from aukit.audio_player import play_sound, play_audio
    from aukit import audio_editor as aed
    inpath = r"hello.wav"
    wav, sr = aukit.load_wav(inpath, with_sr=True)
    aud = aed.wav2audiosegment(wav, sr)
    out = aed.strip_audio(aud)
    wav = aed.audiosegment2wav(out)

    out = aed.remove_silence_wave(wav, sr=sr)
    out = aed.strip_silence_wave(out, sr=sr)

    print(len(wav), len(out))
    play_audio(out, sr)