1

I'm currently looking for some solution or advice. I need to play and control (yep, this is very important for me) many streams (probably from one source). For example.. my system plays some relax music. Someone want to visit me and pressed ring bell. So, at that moment music volume softly decreasing from 100 to 30 (yep, I don't want to turn off music), then I want to hear a ding-dong sound. Finally after ding-dong volume of my music softly increasing back to 100.

Currently, I have MPD + Pulse + CIFS. I know that Pulse basically is a mixer and in theory, I can implement everything that I want, but could someone advise me what to do? :)

user922871
  • 161
  • 2
  • 3

1 Answers1

1

You can control Pulseaudio streams with pacmd from the commandline or a script. Use pacmd list-sink-inputs to see all currently running output streams, pacmd set-sink-input-volume to change volume. pacmd help for a list of all commands.

Not sure how smoothly you can decrease the volume using a loop in a script; if you want the volume to decrease really smoothly, you may have to write a program using the Pulseaudio API.

You can identify streams via client names or properties. Parsing the outputs of pacmd is a bit of a pain, but usually grep or awk will do.

You can play new audiostreams e.g. via paplay, use --client-name and/or --stream-name to help identify the stream.

Obviously you have to script the door bell etc. yourself, this web site is not a script writing service.

dirkt
  • 31,679
  • 3
  • 40
  • 73