diff --git a/README.md b/README.md index a56764d..305805e 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,9 @@ The following APIs are currently available: - snapshot_list - sound - sound_control +- sound_list - status +- voice_list - wakeup diff --git a/handlers.js b/handlers.js index ad3853a..a59296f 100644 --- a/handlers.js +++ b/handlers.js @@ -63,6 +63,7 @@ function homepage(res, req) { + '
  • ears_random
  • ' + '
  • sound(id), sound(url)
  • ' + '
  • sound_control(quit), sound_control(pause)
  • ' + + '
  • sound_list
  • ' + '
  • tts
  • ' + '
  • snapshot
  • ' + '
  • snapshot_list
  • ' @@ -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'); diff --git a/index.js b/index.js index fdfd963..8fdce34 100644 --- a/index.js +++ b/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;