I have a python script that plays a video on system boot. The video has audio but when the system starts and the video plays, no audio can be heard. I have set the mute function to False and volume to 100% but nothing plays. However, if I play the video from desktop via the standard vlc application, there is audio. Then, if i run the script again and the video plays automatically from the python script, there is audio. Whats the problem here?
UPDATE: I realized i didnt have alsa-base and pulseaudio installed on my pi. After installing them, both methods did not give audio.
Create or edit the file /etc/asound.conf
For headphone output:
pcm.!default {
type hw
card 0
}
ctl.!default {
type hw
card 0
}
For HDMI output:
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}
raspberry pi vlc-python no sound