#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2008
    Posts
    30
    Rep Power
    10

    PyAudio Example program: [Errno Input overflowed] - CHANNELS


    It seems there are more than 1 solution to this, including buffer size, sample rate etc, but I have not seen this one given elsewhere.

    In case anyone is having problems running the pyaudio examples like I was please see if this is not your issue

    I was running the "Record a few seconds of audio and save to a WAVE file" example program

    The error I got was

    Traceback (most recent call last):
    File "rec_and_play.py", line 46, in <module>
    data = input_stream.read(BUFFER_SIZE)
    File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 605, in read
    return pa.read_stream(self._stream, num_frames)
    IOError: [Errno Input overflowed] -9981

    Code:
    import audioop
    To show more I placed this under 'for i in range(...)'
    Code:
         data = input_stream.read(BUFFER_SIZE)
         mx = audioop.max(data, 2)
         print mx
    The error appeared after a few (2-5) frames lengths were printed

    please check the CHANNELS variable.
    My audio was mono and it needed CHANNELS=1 in both input and output (if you are using the output). For my situation, this solved the problem.

    Technically, of course, this is my error and not the fault of the program.
  2. #2
  3. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Posts
    5,888
    Rep Power
    509
    Thanks. I use the aplay and arecord programs, as well as writing boring interfaces.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo