diff options
| -rwxr-xr-x | aataaj.lua | 7 |
1 files changed, 5 insertions, 2 deletions
| @@ -162,6 +162,7 @@ if _.runnable('espeak-ng') then speaker = 'espeak-ng' end | |||
| 162 | local numbers = {[0]='zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen'} | 162 | local numbers = {[0]='zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen'} |
| 163 | 163 | ||
| 164 | 164 | ||
| 165 | local Names = {} | ||
| 165 | local Cards = {} | 166 | local Cards = {} |
| 166 | local cnt = 0 | 167 | local cnt = 0 |
| 167 | 168 | ||
| @@ -176,6 +177,7 @@ for i,l in ipairs(cards.lines) do | |||
| 176 | local n = f:read('*a'):sub(1, -2) | 177 | local n = f:read('*a'):sub(1, -2) |
| 177 | Cards[n] = {path = l, name = n, devs = {}, captureDevs = {}, playbackDevs = {}, card=i} | 178 | Cards[n] = {path = l, name = n, devs = {}, captureDevs = {}, playbackDevs = {}, card=i} |
| 178 | cnt = cnt + 1 | 179 | cnt = cnt + 1 |
| 180 | Names[cnt] = n | ||
| 179 | if 'Loopback' ~= Cards[n]['name'] then | 181 | if 'Loopback' ~= Cards[n]['name'] then |
| 180 | Cards[n]['capture'] = __('ls -d1 ' .. l .. '/pcm[0-9]*c*'):noErr():Do() | 182 | Cards[n]['capture'] = __('ls -d1 ' .. l .. '/pcm[0-9]*c*'):noErr():Do() |
| 181 | for j,c in ipairs(Cards[n]['capture'].lines) do | 183 | for j,c in ipairs(Cards[n]['capture'].lines) do |
| @@ -213,7 +215,7 @@ for i,l in ipairs(cards.lines) do | |||
| 213 | end | 215 | end |
| 214 | end | 216 | end |
| 215 | end | 217 | end |
| 216 | table.sort(Cards, function(a, b) return a.card < b.card end) | 218 | --table.sort(Cards, function(a, b) return a.card < b.card end) |
| 217 | print('') | 219 | print('') |
| 218 | io.flush() | 220 | io.flush() |
| 219 | 221 | ||
| @@ -268,8 +270,9 @@ print(' being spoken through all at once - ') | |||
| 268 | end | 270 | end |
| 269 | -- TODO - should do a proper "wait for speakers to finish" here. Have fork(write a file), think that's what :wait(file) does. | 271 | -- TODO - should do a proper "wait for speakers to finish" here. Have fork(write a file), think that's what :wait(file) does. |
| 270 | __'sleep 6':Do() | 272 | __'sleep 6':Do() |
| 271 | for k,C in pairs(Cards) do | ||
| 272 | print(' being spoken through one at a time - ') | 273 | print(' being spoken through one at a time - ') |
| 274 | for k,n in ipairs(Names) do | ||
| 275 | C = Cards[n] | ||
| 273 | for j,c in ipairs(C['playbackDevs']) do | 276 | for j,c in ipairs(C['playbackDevs']) do |
| 274 | ---- speak(C.name, nil, C.card - 1, 'Device number ' .. C.card - 1 .. ', sub device ' .. C['playbackDevs'][j], false, false, 'device', numbers[C.card - 1], 'sub', numbers[tonumber(C['playbackDevs'][j])]) | 277 | ---- speak(C.name, nil, C.card - 1, 'Device number ' .. C.card - 1 .. ', sub device ' .. C['playbackDevs'][j], false, false, 'device', numbers[C.card - 1], 'sub', numbers[tonumber(C['playbackDevs'][j])]) |
| 275 | speak(C.name, C['playbackDevs'][j], C.card - 1, 'Device number ' .. C.card - 1 .. ', sub device ' .. C['playbackDevs'][j], true, false, 'device', numbers[C.card - 1], 'sub', numbers[tonumber(C['playbackDevs'][j])]) | 278 | speak(C.name, C['playbackDevs'][j], C.card - 1, 'Device number ' .. C.card - 1 .. ', sub device ' .. C['playbackDevs'][j], true, false, 'device', numbers[C.card - 1], 'sub', numbers[tonumber(C['playbackDevs'][j])]) |
