You are not logged in.

dc46and2

Beginner

  • "dc46and2" started this thread

Posts: 2

Location: Texas, USA

Occupation: USCG

  • Send private message

1

Sunday, November 20th 2005, 7:16pm

Passing options to external player for notifications.

My sound card can do hardware mixing quite well, so I've decided I don't really need artsd running anymore. For system notifications I'm using /usr/bin/play and this works; however, I can't figure out how to control the volume of the sounds. It should be as simple as passing the -v option to play, but adding any options at all breaks it and I get no system notification sounds at all. Does anybody know how to make this work, or suggest an alternate approach? I guess I could use sound editing software to lower the volume in each wav file, but this seems rather crude and would make it difficult to add or change sound files later.

Here is my knotifyrc: (when it works)

[Misc]
External player=play
LastConfiguredApp=The KDE Window Manager
Use external player=true
Volume=47

[StartProgress]
Arts Init=false
KNotify Init=true
Use Arts=false

The "Volume=" doesn't seem to have any affect unless I use the KDE Sound System (arts) for system notifications. I've tried External player="play -v .3" but this breaks it and I get no system notification sounds at all. I've tried the option on the console so I know I have the syntax right.

Any idea's would be appreciated.

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

2

Sunday, November 20th 2005, 10:34pm

Maybe you can use a simple script instead of play.
Something like this

Source code

1
2
#!/bin/bash
play -v 20 $@


Cheers,
_
Qt/KDE Developer
Debian User

dc46and2

Beginner

  • "dc46and2" started this thread

Posts: 2

Location: Texas, USA

Occupation: USCG

  • Send private message

3

Monday, November 21st 2005, 12:50am

This works great. Thanks for the tip. I never really understood the use of positional parameters, but now I see. (Your suggestion+re-reading bash man page.) I did have to add double quotes around $@ so it would work with file names with spaces in them. Other than that your suggestion was perfect. Thanks again.