User Tools

Site Tools


select-option

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
select-option [2021/10/25 17:14] 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 25: Line 26:
 The result comes back as a object: The result comes back as a object:
 {{::voices.png|}} {{::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>
select-option.txt · Last modified: 2023/04/23 15:52 by admin