Answer the question
In order to leave comments, you need to log in
How to read and write a file at the same time in Python?
Is it possible to simultaneously record audio to a file and at the same time listen to its contents? If this is possible, then I would like to know about the implementation of this on the VLC and Wavio modules in Python. Thanks in advance!
Answer the question
In order to leave comments, you need to log in
It's not about multithreading, or rather not about it alone.
Try reading the file in chunks into a buffer, save the position, and close the file. Wavio is minimalistic, it has only a couple of functions and it does not know how to set the position. But inside there is a wave that has tell and setpos.
When recording, pay attention to buffering, i.e. when exactly is writing to disk.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question