david_1234
Posts: 328
Joined: Mon Jan 01, 2018 2:14 pm

how to control volume output when using external sound card?

Mon Feb 10, 2020 10:39 am

Hello ,
I'm using a USB sound card on my pi
wanted to know how can I chagne the output volume of it ?

I haver try to use this command

Code: Select all

amixer set PCM -- 85%
but it doesn't change the volume

in order to play file I use this command in python

Code: Select all

TestSound = "/home/pi/Documents/test.mp3"
os.system("mpg123 -o alsa:hw:1,0 " + TestSound)
what do I need to add in order to change the volume?

Thanks ,

david_1234
Posts: 328
Joined: Mon Jan 01, 2018 2:14 pm

Re: how to control volume output when using external sound card?

Mon Feb 10, 2020 10:45 am

found it

Code: Select all

 mpg123 -o alsa:hw:1,0 -f -2000 /home/pi/Documents/test.mp3

the maximum value of the amplitude is 100% which coressponds to 32768

got it from here
https://unix.stackexchange.com/question ... -of-mpg123

maybe it will help anyone alse also....

Return to “Beginners”