The following command will start our volume control script. Adjusting the trimpot will printout the OS volume level on the screen.
$ sudo python3 ./code.py
Opening a second terminal on your Raspberry Pi we can run the "speaker-test" command and listen to the volume change as we turn the trimpot.
$ speaker-test -t sine -f 440
The mpg123 command can be used to play MP3 files on your Raspberry Pi. We can open an additional terminal and play MP3 files and adjust the volume with the trimpot we have wired up.
$ mpg123 <MP3 filename>
Page last edited March 08, 2024
Text editor powered by tinymce.