This is all from /usr/lib/cgi-bin/ and /var/www/html/mp3 on Jim-ITX (.45)
$.post("/cgi-bin/t.py",
{
action: "getvoices"
})
.done(function (result, status, xhr) {
console.dir(result);
//const obj = JSON.parse(result);
obj=result;
console.dir(obj);
$.each(obj, function (i, item) {
// console.dir(i);
$('#voice').append($('
The result comes back as a object:
{{::voices.png|}}
t.py code to generate the "result"
if action == "getvoices":
voices = text_to_speech.list_voices().get_result()
v = voices['voices']
persons = {}
for x in v:
name=x['name']
description = x['description']
language = x['language']
if language.startswith('en',0):
nam = re.split(":",description)
persons[nam[0]]=name
jo = json.dumps(persons)
print(jo)