Closed rsingh2083 closed 3 years ago
From the portaudio page : - How do I play or record a file using PortAudio? We do not recommend doing file I/O in the PortAudio callback because the callback is run at a very high priority. We recommend reading the data in a normal priority thread then writing it to a FIFO which is read by the PortAudio callback. V19 has special functions called Pa_WriteStream() and Pa_ReadStream() for doing stream I/O though a FIFO.
Sorry @rsingh2083,
I've no expertise in playing audio. I've just googled playing wav Raspberry PI c++ and follow some promising suggestions.
Hi Sir,
Ive got a .wav file which Im playing whenever any person's Face is detected in camera. Please have a look at the playsound section of this snippet (main.cpp). The sound is playing but I think its slowing down the FaceRecognition also. Is system command slowing down the recognition/detection process ? Is there a faster /better way to play audio without slowing down the recognition/detection ?
On the FaceMaskRecognition console im getting this error. I think whenever a face is detected audio is being called to play while the previous audio file hasnt finished playing. Is there a way to solve this ?
aplay : audio open error: device or resource busy