Added API: voice_list.

This commit is contained in:
Olivier Bagot 2013-11-20 13:24:53 +01:00
parent d83d8805fe
commit 146eab9107
2 changed files with 36 additions and 12 deletions

View File

@ -67,7 +67,10 @@ function homepage(res, req) {
+ '<li><a target="results" href="/cgi-bin/snapshot">snapshot</a></li>'
+ '<li><a target="results" href="/cgi-bin/snapshot_list">snapshot_list</a></li>'
+ '<li><a target="results" href="/cgi-bin/snapshot_get">snapshot_get</a>, <a target="results" href="/cgi-bin/snapshot_get?filename=snapshot.thumb.gif">snapshot_get(thumbnail)</a></li>'
+ '</ul>' + '</body>' + '</html>';
+ '<li><a target="results" href="/cgi-bin/voice_list">voice_list</a></li>'
+ '</ul>'
+ '</body>'
+ '</html>';
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;

View File

@ -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);