diff options
Diffstat (limited to 'aataaj.lua')
| -rwxr-xr-x | aataaj.lua | 25 |
1 files changed, 13 insertions, 12 deletions
| @@ -5,7 +5,7 @@ | |||
| 5 | # Provides: aataaj | 5 | # Provides: aataaj |
| 6 | # Required-Start: $local_fs | 6 | # Required-Start: $local_fs |
| 7 | # Required-Stop: | 7 | # Required-Stop: |
| 8 | # X-Start-Before: alsa-utils espeakup | 8 | # X-Start-Before: alsa-utils espeakup networking |
| 9 | # Default-Start: S | 9 | # Default-Start: S |
| 10 | # Default-Stop: | 10 | # Default-Stop: |
| 11 | # Short-Description: Scan for audio devices. | 11 | # Short-Description: Scan for audio devices. |
| @@ -218,6 +218,18 @@ io.flush() | |||
| 218 | 218 | ||
| 219 | 219 | ||
| 220 | print('Your ' .. cnt .. ' audio devices are - ') | 220 | print('Your ' .. cnt .. ' audio devices are - ') |
| 221 | print(' being turned on and volume maxed - ') | ||
| 222 | for k = 0, cnt do | ||
| 223 | -- Turn on IEC958 for everything, they seem to default to off, so can't hear them. | ||
| 224 | for l, m in ipairs(__("amixer -c " .. k .. " scontrols | grep 'IEC958' | cut -d ',' -f 2"):noErr():Do().lines) do | ||
| 225 | __("amixer -c " .. k .. " set IEC958," .. m .. " on"):Do() | ||
| 226 | end | ||
| 227 | -- Turn the volume to maximum for everything. | ||
| 228 | for l, m in ipairs(__("amixer -c " .. k .. " controls | grep ' Playback Volume' | cut -d ',' -f 1"):noErr():Do().lines) do | ||
| 229 | __("amixer -c " .. k .. " cset iface=MIXER,name='PCM Playback Volume," .. m .. "' 100% "):Do() | ||
| 230 | end | ||
| 231 | end | ||
| 232 | |||
| 221 | 233 | ||
| 222 | local speak = function(card, subdevice, device, words, printIt, forkIt, ...) | 234 | local speak = function(card, subdevice, device, words, printIt, forkIt, ...) |
| 223 | local files = {...} | 235 | local files = {...} |
| @@ -242,17 +254,6 @@ end | |||
| 242 | -- TODO - Start with the device, then go through the sub devices. Coz at boot time subs don't seem to work. | 254 | -- TODO - Start with the device, then go through the sub devices. Coz at boot time subs don't seem to work. |
| 243 | -- Likely that'll lock things up at "all speak at once" time. | 255 | -- Likely that'll lock things up at "all speak at once" time. |
| 244 | if 'start' == cmd then | 256 | if 'start' == cmd then |
| 245 | print(' being turned on and volume maxed - ') | ||
| 246 | for k = 0, cnt do | ||
| 247 | -- Turn on IEC958 for everything, they seem to default to off, so can't hear them. | ||
| 248 | for l, m in ipairs(__("amixer -c " .. k .. " scontrols | grep 'IEC958' | cut -d ',' -f 2"):noErr():Do().lines) do | ||
| 249 | __("amixer -c " .. k .. " set IEC958," .. m .. " on"):Do() | ||
| 250 | end | ||
| 251 | -- Turn the volume to maximum for everything. | ||
| 252 | for l, m in ipairs(__("amixer -c " .. k .. " controls | grep ' Playback Volume' | cut -d ',' -f 1"):noErr():Do().lines) do | ||
| 253 | __("amixer -c " .. k .. " cset iface=MIXER,name='PCM Playback Volume," .. m .. "' 100% "):Do() | ||
| 254 | end | ||
| 255 | end | ||
| 256 | 257 | ||
| 257 | print(' being spoken through all at once, then one at a time - ') | 258 | print(' being spoken through all at once, then one at a time - ') |
| 258 | print('Please type the device number you hear best - ') | 259 | print('Please type the device number you hear best - ') |
