0

For example, I have an open browser with youtube or another program that plays audio and would like to get the current audio level as a number between 0-100%. To be more precise, I've seen answers with commands that showed the set audio level in the system, but I want to see the audio level that comes from applications that play audio.

1
  • Which audio system are you using? Alsa, pulse? If you don't know, telling us how you do set the volume might help find out how to read the current level. May 14, 2020 at 18:42

1 Answer 1

0

If your system is using pulse audio, you can list the playing applications with pacmd

Here only firefox is playing, with a volume of 54%:

hoov@hal:~$ pacmd list-sink-inputs 
1 sink input(s) available.
    index: 4577
        driver: <protocol-native.c>
        flags: START_CORKED 
        state: RUNNING
        sink: 0 <alsa_output.pci-0000_00_1b.0.analog-stereo>
        volume: front-left: 35578 /  54% / -15,92 dB,   front-right: 35578 /  54% / -15,92 dB
                balance 0,00
        muted: no
        current latency: 89,62 ms
        requested latency: 75,00 ms
        sample spec: float32le 2ch 48000Hz
        channel map: front-left,front-right
                     Stereo
        resample method: speex-float-1
        module: 14
        client: 840 <Firefox>
        properties:
                media.name = "AudioStream"
                application.name = "Firefox"
                native-protocol.peer = "UNIX socket client"
                native-protocol.version = "33"
                application.process.id = "11744"
                application.process.user = "gobuki"
                application.process.host = "morpheus"
                application.process.binary = "firefox"
                application.language = "en_US.UTF-8"
                window.x11.display = ":0"
                application.process.machine_id = "0f06bccf24c24ae5ba5d40c54b7d8f58"
                application.process.session_id = "2"
                application.icon_name = "firefox"
                module-stream-restore.id = "sink-input-by-application-name:Firefox"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .