1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Convert wav to mulaw in Python

Discussão em 'Python' iniciado por Stack, Setembro 11, 2024.

  1. Stack

    Stack Membro Participativo

    I'm opening a wav file and attempting to convert it into mulaw unsuccessfully. The mulaw is then sent to Twilio to play. The code is as follows:

    with wave.open('audio/test.wav', 'rb') as wav:
    raw_wav= wav.readframes(wav.getnframes())
    raw_ulaw = audioop.lin2ulaw(raw_wav, wav.getsampwidth())


    The conversion does happen but the resulting mulaw is just static sound, no speech. Any help would be appreciated. Thanks.

    Continue reading...

Compartilhe esta Página