anyone had any luck enabling audio with a headless (no monitor, no mouse, no keyboard) set up? trying to run a python scrtipt that generates text to speech via pyttsx3. the script runs using crontab to kick it off; i know its running as i have gpio led lights to indicate a ready state but upon pushing the capture button to start the script no sound comes out. in the script i am using os.system() to force the audio to a specific usb audio device and set volume via:
pactl set-default-sink ‘alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo’
pactl set-sink-volume 0 90%
this all works when connecting a monitor and mouse and keyboard as well as when i ssh into the machine.
jsut to note i tried using crontab, systemctl (setting up service), rc.local, using the gui to manually set the default card, forcing pulse audio to start using os.system(r"pulseaudio --start") directly in the script; none of which have worked!