« Local LANsome more MythTV improvements »

MythTV sound effect for pressing Remote button

2007/08/10

  07:58:06 pm, by   , 596 words  
Categories: Gentoo Linux, MythTV

MythTV sound effect for pressing Remote button

Another pointer I found at this site:

http://outflux.net/blog/archives/2005/10/16/mythtv-button-sounds/

is about how to add sounds to MythTV remote buttons being pushed - kinda handy.

First create the script, taken pretty much from the page:

# nano /usr/local/bin/irnoise

#!/bin/bash
export SOUNDS=/home/mythtv/sounds

ircat mythtv | while read NAME; do
  case "$NAME" in
   Return|Space)
    SOUND=select.wav
    ;;
   *)
    SOUND=default.wav
    ;;
  esac
  #echo "$NAME: $SOUND"
  aplay -q "$SOUNDS/$SOUND"
done

Then grab some sounds. I used the URL from the blog:

http://wa8lmf.net/aprs/wavaudio.htm

When I tried these via the command line:

# aplay -q /home/mythtv/sounds/AHOOGA.WAV

I noticed some pops - so I decided to try out what the blog said - re-encode the audio using 'sox':

# emerge -av media-sound/sox
# emerge -av media-sound/normalize
# sox /home/mythtv/sounds/THUD.WAV -t wav -c 1 -s -w -r 48000 /home/mythtv/sounds/default.wav resample
# sox /home/mythtv/sounds/BTN_DWN.WAV -t wav -c 1 -s -w -r 48000 -v 2 /home/mythtv/sounds/select.wav resample
# chown mythtv:users /home/mythtv/sounds/default.wav
# chown mythtv:users /home/mythtv/sounds/select.wav
# normalize -m /home/mythtv/sounds/default.wav /home/mythtv/sounds/select.wav
Computing levels...
 select.wav        100% done, ETA 00:00:00 (batch 100% done, ETA 00:00:00)
Applying adjustment of -0.72dB to /home/mythtv/sounds/default.wav...
 default.wav       100% done, ETA 00:00:00 (batch  32% done, ETA 00:00:00)
Applying adjustment of 0.78dB to /home/mythtv/sounds/select.wav...
 select.wav        100% done, ETA 00:00:00 (batch 100% done, ETA 00:00:00)

Then make the script executable:

# chmod +x /usr/local/bin/irnoise

and then add the command to fire it off into the .xintirc config file:

# cat /home/mythtv/.xinitrc
# Merge X resources from ~/.Xdefaults
[ -f $HOME/.Xdefaults ] [amp][amp] xrdb $HOME/.Xdefaults

# Set the background and root cursor shape
xsetroot -solid \#000000
xsetroot -cursor_name watch
#xsetroot -cursor_name top_left_arrow

# used to headset volume and keyboard commands
lineakd [amp]

# create sounds for remote buttons presses
/usr/local/bin/irnoise [amp]

# Start evilwm - snap to borders within 10 pixels
#/usr/bin/evilwm -snap 6 -bw 0 [amp]
#/usr/bin/evilwm -snap 6 -bw 0 -fg \#000000 -bg 0 -fc 0 [amp]
/usr/bin/evilwm -snap 6 -bw 0 -fg \#000000 -bg \#000000 -fc \#000000 [amp]
wmpid=$!

# turn off monitor poewr save, etc
/usr/X11R6/bin/xset s noblank [amp]
/usr/X11R6/bin/xset s off [amp]
/usr/X11R6/bin/xset -dpms [amp]

# font antialiasing
export QT_XFT=1

# to make MythTV use TV as primary display
#export DISPLAY=:0.1
#mythfrontend

# add " -l ~/mythfrontend.log" or " -l /var/log/mythtv/mythfrontend.log" to have front end logging
mythfrontend -l ~/mythfrontend.log -nw --geometry 1280x1024 [gt] ~/startxcommand.log
#mythfrontend -l ~/mythfrontend.log -nw --geometry 1024x768 [gt] ~/startxcommand.log


# used for getting data about screen resolution and DPI for x sessions
#xdpyinfo [gt] test.xdpyinfo2

# sleep makes it so irxevent works
# uncomment these if you don't compile lirc into mythtv
#(set the lirc USE variable to compile lirc support into mythtv)
#sleep 3
#irxevent [amp]

# when the window manager exits, allow the X server to be torn down
#wait $wmpid

Lots of excess stuff in that file ... however the effect now works great :-)

Then I remembered I had some Star Trek Original Series Sounds, so after getting the files over and converted, the 'irnoise' script became this:

#!/bin/bash
export SOUNDS=/home/mythtv/sounds

ircat mythtv | while read NAME; do
  case "$NAME" in
   Return|Space|OK)
    SOUND=button4.wav
    ;;
   Left|Right|Up|Down)
    SOUND=button1.wav
    ;;
   F5|F6|F7|F8|F3|F9)
    SOUND=button2.wav
    ;;
   Play|Stop)
    SOUND=button3.wav
    ;;
   *)
    SOUND=default.wav
    ;;
  esac
  #echo "$NAME: $SOUND"
  aplay -q "$SOUNDS/$SOUND"
done

Feedback awaiting moderation

This post has 11 feedbacks awaiting moderation...


Form is loading...

March 2021
Mon Tue Wed Thu Fri Sat Sun
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
 << <   > >>
LAN / Networks related items ...

Search

  XML Feeds

powered by b2evolution