Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pyAudio playing variable
#4
Yes thats true but on this example you play a WAV file not a WAV variable.
On my example it neeeds an Integrer instead of bytes so I've tried

    def play(self, recording):
        print('Playing...')
       while len(recording) > 0:
            # self.stream.read(recording)
            self.stream.read(int.from_bytes(recording, 'little', signed=True))
            self.stream.readframes(CHUNK)
 
        # cleanup stuff.
        self.p.close()
        self.p.terminate()
But the error is:

Error:
"/home/user/.local/lib/python3.7/site-packages/pyaudio.py", line 608, in read return pa.read_stream(self._stream, num_frames, exception_on_overflow) OverflowError: Python int too large to convert to C long
Any better solutions to fix that?

I want understand and learn how to fix errors not giving anyone a Job Big Grin

Regards
Talking2442
Reply


Messages In This Thread
pyAudio playing variable - by Talking2442 - Nov-30-2020, 12:35 PM
RE: pyAudio playing variable - by Talking2442 - Dec-01-2020, 12:19 PM
RE: pyAudio playing variable - by snippsat - Dec-01-2020, 02:36 PM
RE: pyAudio playing variable - by Talking2442 - Dec-01-2020, 06:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pyaudio seems to randomly halt input. elpidiovaldez5 2 445 Jan-22-2024, 09:07 AM
Last Post: elpidiovaldez5
  Not getting response from pyaudio OceansBlue 1 2,704 Jul-03-2021, 06:22 AM
Last Post: OceansBlue
  help with PyAudio Leo12143 1 2,001 Jan-18-2021, 09:56 AM
Last Post: DT2000
  Pyaudio Souls99 7 3,667 Oct-05-2020, 04:06 PM
Last Post: Larz60+
  PyAudio [Errorno -9999] Unanticipated Host Error iMuny 5 5,831 Sep-21-2020, 06:58 PM
Last Post: jefsummers
  PyAudio Buffer Data Calculation MclarenF1 0 2,182 Aug-21-2020, 10:55 AM
Last Post: MclarenF1
  PyAudio throwing Input overflowed anthares 3 4,909 Jun-14-2020, 03:37 PM
Last Post: anthares
  Using pyaudio to stop recording under certain sound threshold Twanski94 2 6,596 Jun-13-2020, 11:35 AM
Last Post: Twanski94
  update imhow in callback from pyaudio markB 0 2,401 May-28-2020, 06:01 PM
Last Post: markB
  When piping a FFMPEG stream to PyAudio, I get a "click" on every loop klehman 0 4,926 Dec-15-2019, 04:22 AM
Last Post: klehman

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020