Send feedback
mp.tasks.audio.TextToSpeechOptions
Stay organized with collections
Save and categorize content based on your preferences.
Options for MediaPipe TextToSpeech task.
mp . tasks . audio . TextToSpeechOptions (
base_options : mp . tasks . BaseOptions ,
default_voice_id : str = '' ,
default_locale : Optional [ str ] = None ,
speaking_rate : float = 1.0 ,
target_bucket : int = 0 ,
cache_directory : Optional [ str ] = None
)
Attributes
base_options
Base options for the MediaPipe task (model path and delegate).
default_voice_id
Default speaker voice ID when not overridden per call.
default_locale
Default BCP-47 locale tag when not overridden per call; when
None, the language is inferred from the selected voice.
speaking_rate
Playback speaking rate multiplier (1.0 is normal speed).
target_bucket
Fixed phoneme token bucket length (0 selects adaptive
bucketing).
cache_directory
Optional directory path for compiled weight/program caches;
None disables disk caching.
Methods
__eq__
__eq__ (
other
)
Return self==value.
Class Variables
cache_directory
None
default_locale
None
default_voice_id
''
speaking_rate
1.0
target_bucket
0
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-11-05 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-11-05 UTC."],[],[]]