Sample Header Ad - 728x90

Control volume of mpg123

3 votes
2 answers
10245 views
Good time of day! Currently developing something like "smart home" and I need to start different audio streams with different volume level. For example, I want to hear background music with 20% of original volume but in case if someone press door bell then I want to hear that bell ring with 100% volume. For my purposes currently, I'm using mpg123 with Python scripts. Python script with pexpect runs mpg123 with needed settings like mpg123 -vC Current approach sends 's' like pause immediately after the player starts. Then I'm sending needed count of '-' like decrease volume by 2 to the player and resume it. Huh... it works but an implementation is ugly, and there is some gap between the player start and volume decreasing. At least I hear few first "packets" before python script actually pauses player and decrease volume. Is there any way to reduce the volume by some command? Is there any way to start mpg123 paused? At least to eliminate that gap Thanks!
Asked by user922871 (191 rep)
Jul 5, 2017, 10:02 PM
Last activity: Jul 4, 2025, 06:40 PM