0

I use pyaudio with python2.7.13 to record wav ,but my pragram dead when I record more than 1 hour , how can I do if I want to record for more than 1 hour with py2.7. Thanks for your replay!

z.fx
  • 3
  • 2
  • For an example, have a look at [rec_unlimited.py](https://github.com/spatialaudio/python-sounddevice/blob/master/examples/rec_unlimited.py). – Matthias May 17 '17 at 09:00

1 Answers1

2

Surely you can record audio for more than an hour using pyaudio. Try invoking the recording function in a thread and put the main process in a loop or sleep for that period. Note: Make sure you do not run out of memory.

PyManiac
  • 474
  • 4
  • 12
  • Thank you very much,I have invoked the recording function in a new thread out of the main loop,and use "join()" to make the main loop wait it.It worked effectively! I will appreciate it if you can tell me the reason of it or give me some document to read. – z.fx May 18 '17 at 03:10
  • It is a generalized practice to do so. For a better understanding of what happens under the hood , you can refer here. http://stackoverflow.com/questions/28417733/pyaudio-responsive-recording/28418081#28418081 – PyManiac May 18 '17 at 03:52