speechGetVoices

Typehandler
Dictionarynative.speech
LibrarySpeech Library
Syntax
speechGetVoices()
Associationscom.livecode.library.native.speech
Summary

Get an array of system voice information

OSmac, ios, android
Platformsdesktop, mobile
Example
    local tVoices
    put speechGetVoices() into tVoices

    local tEnglishVoiceNames
    repeat for each element tVoice in tVoices
        if tVoice["locale"] begins with "en" then
            put tVoice["name"] & return after tEnglishVoiceNames
        end if
    end repeat
Description

Use speechGetVoices to obtain details of the system voices. Each key in the returned array is a voice identifier that can be used with the speechSetVoice command. Each element has a name and a locale key:

  • name: A name for the voice
  • locale: A locale for the voice

Note: Getting voices is supported on Android 6+. On earlier versions this handler returns nothing.