Answer the question
In order to leave comments, you need to log in
How to save PCM in binary form to wav in python?
Hello! I deal with one problem. There is an api that synthesizes speech:
I did it according to the instructions and PCM
But this is only a part, how to make it so that from the web socket you get more than one first message, but all until it runs out?
async with websockets.connect(uri) as websocket:
await websocket.send(data)
sound = await websocket.recv()
print(f"< {sound}")
with wave.open('test.wav', 'wb') as wavfile:
wavfile.setparams((1, 2, 22050, 0, 'NONE', 'not compressed'))
wavfile.writeframes(sound)
Answer the question
In order to leave comments, you need to log in
Hello!
Got it? I have an interest in this task of yours.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question