#!/bin/sh # earcons.sh DIR: the box's earcons, told apart by contour; low and long enough for older ears. # 16 kHz, the mics' rate: they play while the mics record, on one I2S bus. # open C E G rising, with a little echo: a press; a conversation starts; your turn # turn one soft G: your turn again # gotit E C falling, short: heard you; thinking # huh D A low: didn't catch that; your turn again # bye G E C falling, with echo: the conversation is over # look A A, two quick taps, like a shutter: the brain is looking through the camera set -eu dir=$1 mkdir -p "$dir" tmp=$(mktemp -d) trap 'rm -rf "$tmp"' EXIT note() { # note NAME HZ SECONDS GAIN sox -R -n -r 16000 -c 1 -b 16 "$tmp/$1.wav" synth "$3" sine "$2" fade q 0.005 "$3" 0.04 gain "$4" } note C5 523.25 0.09 -7; note E5 659.25 0.09 -7; note G5 783.99 0.09 -7 note G5soft 783.99 0.14 -11 note E5s 659.25 0.07 -9; note C5s 523.25 0.10 -9 note D4 293.66 0.12 -6; note A3 220.00 0.16 -6 note A5 880.00 0.06 -9 sox -n -r 16000 -c 1 -b 16 "$tmp/gap.wav" trim 0 0.08 sox -R "$tmp/C5.wav" "$tmp/E5.wav" "$tmp/G5.wav" "$dir/open.wav" echo 0.8 0.7 60 0.3 pad 0 0.1 sox -R "$tmp/G5soft.wav" "$dir/turn.wav" echo 0.8 0.7 60 0.3 pad 0 0.05 sox -R "$tmp/E5s.wav" "$tmp/C5s.wav" "$dir/gotit.wav" pad 0 0.05 sox -R "$tmp/D4.wav" "$tmp/A3.wav" "$dir/huh.wav" pad 0 0.05 sox -R "$tmp/G5.wav" "$tmp/E5.wav" "$tmp/C5.wav" "$dir/bye.wav" echo 0.8 0.7 60 0.3 pad 0 0.1 sox -R "$tmp/A5.wav" "$tmp/gap.wav" "$tmp/A5.wav" "$dir/look.wav" pad 0 0.05