raspberry pi 4 audio output code example
Example 1: sound output raspberry pi
# You can juste type the command bellow on the terminal
amixer cset numid=3 0
#the last figure acn be: 0 for auto, 1 for 3.5mm Jack or 2 for HDMI
Example 2: video and audio using raspberry
ffmpeg -y -ac 1 -f alsa -i hw:1,0 -i /dev/video1 -r 10 -s 120*120 -async 1 -strict -2 -c:a aac -pix_fmt yuv420p -threads 0 -ar 44100 -f mpegts out.avi