25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

83 satır
1.4 KiB

  1. #!/bin/bash
  2. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
  3. export ROOT=`dirname "$DIR"`
  4. export SOUNDS=$ROOT/sounds
  5. export PLAYER=mplayer
  6. export SPEAK=espeak-ng
  7. function info() {
  8. echo "[INFO]" $@
  9. }
  10. function play() {
  11. $PLAYER $@ > /dev/null 2>&1
  12. }
  13. function pa-volume() {
  14. amixer cset numid=3,iface=MIXER,name='Line Out Playback Volume' $1 > /dev/null
  15. }
  16. function pa-volume-normal() {
  17. info "Volume set to Normal"
  18. pa-volume 15
  19. }
  20. function pa-volume-loud() {
  21. info "Volume set to HIGH!"
  22. pa-volume 25
  23. }
  24. function pa-volume-quiet() {
  25. info "Volume set to low"
  26. pa-volume 8
  27. }
  28. function pa-preheat() {
  29. info "PA Preheating"
  30. pa-power off
  31. pa-volume-normal
  32. play $SOUNDS/announcement_4-tone_up_quickest.ogg
  33. pa-power on
  34. info "PA Ready"
  35. }
  36. function pa-shutdown() {
  37. info "PA Shutdown"
  38. pa-power off
  39. pa-volume-normal
  40. }
  41. function pa-announcement() {
  42. info " DING DONG "
  43. play $SOUNDS/announcement_4-tone_up_smooth.ogg
  44. }
  45. function pa-announcement-quick() {
  46. info " Ding Dong "
  47. play $SOUNDS/announcement_4-tone_up_smooth_quick.ogg
  48. }
  49. function pa-announcement-quickest() {
  50. info " ding-dong "
  51. play $SOUNDS/announcement_4-tone_up_quickest.ogg
  52. }
  53. function pa-alarm-start() {
  54. info "Alarm started"
  55. play -loop 0 $SOUNDS/alarm_simple.ogg &
  56. }
  57. function pa-alarm-stop() {
  58. info "Alarm stopped"
  59. killall $PLAYER
  60. }
  61. function pa-say() {
  62. info "Say: $@"
  63. $SPEAK "$@"
  64. }