You are not logged in.

#1 2009-04-07 01:41:22

xkero
Member
Registered: 2008-04-20
Posts: 7

Getting dB or "loudness" of line in via cli (ALSA)

I want to run a command when sound is transmitted across the line in. Now I know that the audio ports are dumb and don't know when they are actually being used, but is there some way of reading how loud the sound is that's comming into the line in . At the very least is it possible to detect an absense of silence on the line in. In case I didn't make that very clear or before someone askes why I'd want to do this; I have two computers, but only one set of speakers. So I connected the speaker output on one computer to the line in of the other via a male-male cable. This works fantasticly allowing me to play sound on both machines through one set of speakers without having to unplug them. I want to have my cake and eat it too and have the program (MPD) that's playing sound on the computer with speakers pause when the other computer plays something. Is this possible?

Offline

#2 2009-04-07 12:59:19

test1000
Member
Registered: 2005-04-03
Posts: 834

Re: Getting dB or "loudness" of line in via cli (ALSA)

try looking in the alsa-tools package if there's something there that can help you. I couldn't get it to compile though but i'm only doing this for you so there weren't much motivation to fix it tongue

EDIT: it works when done as this(as root): makepkg --asroot, but after 5 minutes of research i'm not sure this is the solution..

Another thing is you could try fuser /dev/sound/audio and when a new process starts pause/mute the audio on the other comp. this will only work if mpd only hogs the audio device when it's actually playing though.

Last edited by test1000 (2009-04-07 13:08:03)


KISS = "It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience." - Albert Einstein

Offline

Board footer

Powered by FluxBB