[Python] What frame rate to expect using Python sounddevice.InputStream on macbook?

Discussão em 'Python' iniciado por Stack, Março 2, 2025.

  1. Stack

    Stack Membro Participativo

    I record audio on a macbook using this code:

    def callback(indata, frame_count, time_info, status):
    if status:
    print('Error:', status)
    frames.append(indata.copy())
    ...

    with sd.InputStream(callback=callback, channels=1, samplerate=1600) as stream:
    while True:
    sd.sleep(100)



    After 5 seconds passed I get only ~5000 frames in total and about 100 frames per sleep call. I don't understand why the frame count is so low, shouldn't it be 16000 frames per second?

    Continue reading...

Compartilhe esta Página