diff --git a/handlers.js b/handlers.js index e4ab186..ad3853a 100644 --- a/handlers.js +++ b/handlers.js @@ -67,7 +67,10 @@ function homepage(res, req) { + '
  • snapshot
  • ' + '
  • snapshot_list
  • ' + '
  • snapshot_get, snapshot_get(thumbnail)
  • ' - + '' + '' + ''; + + '
  • voice_list
  • ' + + '' + + '' + + ''; res.writeHead(200, { 'Server': 'OpenKarotz Emulator WebServer 1.0', @@ -415,3 +418,23 @@ function snapshot_get(res, req) { } exports.snapshot_get = snapshot_get; +function voice_list(res, req) { + log.trace('voice_list: begin'); + + var data = '{ "voices": [' + + '{ "id":"alice","lang":"fr"},' + + '{ "id":"claire","lang":"fr"},' + + '{ "id":"julie","lang":"fr"},' + + '{ "id":"justine","lang":"fr"},' + + '{ "id":"margaux","lang":"fr"},' + + '{ "id":"louise","lang":"fr"},' + + '{ "id":"antoine","lang":"fr"},' + + '{ "id":"bruno","lang":"fr"},' + + '{ "id":"heather","lang":"us"},' + + '{ "id":"ryan","lang":"us"}' + + '], "return":"0" }'; + + sendResponse(res, data); + log.trace('voice_list: end'); +} +exports.voice_list = voice_list; diff --git a/index.js b/index.js index 6bbf478..fdfd963 100644 --- a/index.js +++ b/index.js @@ -35,22 +35,23 @@ var handlers = require('./handlers'); var handle = {}; handle['/'] = handlers.homepage; handle['/cgi-bin'] = handlers.homepage; -handle['/cgi-bin/sleep'] = handlers.sleep; -handle['/cgi-bin/wakeup'] = handlers.wakeup; -handle['/cgi-bin/reboot'] = handlers.reboot; -handle['/cgi-bin/status'] = handlers.status; -handle['/cgi-bin/get_version'] = handlers.get_version; -handle['/cgi-bin/get_free_space'] = handlers.get_free_space; -handle['/cgi-bin/leds'] = handlers.leds; handle['/cgi-bin/ears'] = handlers.ears; -handle['/cgi-bin/ears_reset'] = handlers.ears_reset; handle['/cgi-bin/ears_random'] = handlers.ears_random; +handle['/cgi-bin/ears_reset'] = handlers.ears_reset; +handle['/cgi-bin/get_free_space'] = handlers.get_free_space; +handle['/cgi-bin/get_version'] = handlers.get_version; +handle['/cgi-bin/leds'] = handlers.leds; +handle['/cgi-bin/reboot'] = handlers.reboot; +handle['/cgi-bin/sleep'] = handlers.sleep; +handle['/cgi-bin/snapshot'] = handlers.snapshot; +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/status'] = handlers.status; handle['/cgi-bin/tts'] = handlers.tts; -handle['/cgi-bin/snapshot'] = handlers.snapshot; -handle['/cgi-bin/snapshot_list'] = handlers.snapshot_list; -handle['/cgi-bin/snapshot_get'] = handlers.snapshot_get; +handle['/cgi-bin/voice_list'] = handlers.voice_list; +handle['/cgi-bin/wakeup'] = handlers.wakeup; log.info('OpenKarotz Emulator'); server.start(router.route, handle);