So you're saying that I should switch to python-soundevice?1) What was the issue?No, my pi isn't headless. I have a TV with a keyboard and mouse connected.
No. By headless I mean without monitor (and keyboard, and mouse).
BTW, that user's systemd solution didn't work. I doubt that's the best method anyway.
My pi is headless. It works very well there.
Recently I have been facing issues after switching to a compute module...but I guess that's another issue.
Try looking at the journaland see what went wrong.Code:
journalctl -u your_service_name.service
Did the service not start on boot? Did the python code not execute?
2) One more thing, pyaudio has gotten old.
I switched to python-sounddevice after facing several problems with it. It does the same thing as pyaudio, and it's also a wrapper around PortAudio. But it has better documentation and is easier to use. You can see if that works for you.
https://pypi.org/project/sounddevice/
3) Most of the error message you are getting from pyaudio is unnecessary warnings. Try suppressing them, then you will be able to see the actual error more clearly. Take a look at this answer.
https://stackoverflow.com/questions/677 ... isy-output
4) It could be that pyaudio ends up using the wrong audio card, since you have HDMI etc. Try setting the audio card explicitly. In Sounddevice it's done by:. You can find the available audio device by runningCode:
sounddevice.default.device = audio_device
in your command line.Code:
arecord -l
Also, when I run the .service file just from terminal, it works, but when I run it on startup I get an error. (my script has an error function) But what is weird is when I first ran the .service file the first few times, it worked, but after like 5 or 6 it stopped working. Any idea why?
Statistics: Posted by Henrik Gill — Wed Aug 21, 2024 8:24 pm