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 revisionBoth sides next revision
select-option [2021/10/25 17:14] adminselect-option [2021/10/25 17:16] admin
Line 25: Line 25:
 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