Added API: sound_list.
This commit is contained in:
parent
146eab9107
commit
9982925cef
@ -20,7 +20,9 @@ The following APIs are currently available:
|
||||
- snapshot_list
|
||||
- sound
|
||||
- sound_control
|
||||
- sound_list
|
||||
- status
|
||||
- voice_list
|
||||
- wakeup
|
||||
|
||||
|
||||
|
26
handlers.js
26
handlers.js
@ -63,6 +63,7 @@ function homepage(res, req) {
|
||||
+ '<li><a target="results" href="/cgi-bin/ears_random">ears_random</a></li>'
|
||||
+ '<li><a target="results" href="/cgi-bin/sound?id=bip">sound(id)</a>, <a target="results" href="/cgi-bin/sound?url=http://play/sound">sound(url)</a></li>'
|
||||
+ '<li><a target="results" href="/cgi-bin/sound_control?cmd=quit">sound_control(quit)</a>, <a target="results" href="/cgi-bin/sound_control?cmd=pause">sound_control(pause)</a></li>'
|
||||
+ '<li><a target="results" href="/cgi-bin/sound_list">sound_list</a></li>'
|
||||
+ '<li><a target="results" href="/cgi-bin/tts?text=Hello%20World">tts</a></li>'
|
||||
+ '<li><a target="results" href="/cgi-bin/snapshot">snapshot</a></li>'
|
||||
+ '<li><a target="results" href="/cgi-bin/snapshot_list">snapshot_list</a></li>'
|
||||
@ -333,6 +334,31 @@ function sound_control(res, req) {
|
||||
}
|
||||
exports.sound_control = sound_control;
|
||||
|
||||
function sound_list(res, req) {
|
||||
log.trace('sound_list: begin');
|
||||
|
||||
var data = '{"sounds": ['
|
||||
+ '{"id":"bip1"},'
|
||||
+ '{"id":"bling"},'
|
||||
+ '{"id":"flush"},'
|
||||
+ '{"id":"install_ok"},'
|
||||
+ '{"id":"jet1"},'
|
||||
+ '{"id":"laser_15"},'
|
||||
+ '{"id":"merde"},'
|
||||
+ '{"id":"ready"},'
|
||||
+ '{"id":"rfid_error"},'
|
||||
+ '{"id":"rfid_ok"},'
|
||||
+ '{"id":"saut1"},'
|
||||
+ '{"id":"start"},'
|
||||
+ '{"id":"twang_01"},'
|
||||
+ '{"id":"twang_04"}'
|
||||
+ '],"return":"0"}';
|
||||
|
||||
sendResponse(res, data);
|
||||
log.trace('sound_list: end');
|
||||
}
|
||||
exports.sound_list = sound_list;
|
||||
|
||||
function tts(res, req) {
|
||||
log.trace('tts: begin');
|
||||
|
||||
|
1
index.js
1
index.js
@ -48,6 +48,7 @@ handle['/cgi-bin/snapshot_get'] = handlers.snapshot_get;
|
||||
handle['/cgi-bin/snapshot_list'] = handlers.snapshot_list;
|
||||
handle['/cgi-bin/sound'] = handlers.sound;
|
||||
handle['/cgi-bin/sound_control'] = handlers.sound_control;
|
||||
handle['/cgi-bin/sound_list'] = handlers.sound_list;
|
||||
handle['/cgi-bin/status'] = handlers.status;
|
||||
handle['/cgi-bin/tts'] = handlers.tts;
|
||||
handle['/cgi-bin/voice_list'] = handlers.voice_list;
|
||||
|
Loading…
x
Reference in New Issue
Block a user