User Tools

Site Tools


select-option

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
select-option [2021/10/25 16:47] – created adminselect-option [2021/10/25 17:19] admin
Line 1: Line 1:
 +This is all from /usr/lib/cgi-bin/ and /var/www/html/mp3 on Jim-ITX (.45)
 <code> <code>
     $.post("/cgi-bin/t.py",     $.post("/cgi-bin/t.py",
Line 22: Line 23:
         });         });
  
 +</code>
 +The result comes back as a object:
 +{{::voices.png|}}
 +
 +t.py code to generate the "result"
 +
 +<code>
 +    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)
 </code> </code>
select-option.txt · Last modified: 2023/04/23 15:52 by admin