### Full TTS Announcement Example Source: https://github.com/nimroddolev/chime_tts/wiki/chime_tts.say A comprehensive example demonstrating multiple features: pre and post chimes, custom playback speed, Australian accent, multi-speaker synchronization, volume control, caching, and announcement resumption. ```yaml service: chime_tts.say data: chime_path: drumroll end_chime_path: /media/sounds/cheer.mp3 message: The washing's done! tts_platform: google_translate tts_playback_speed: 120 volume_level: 0.7 join_players: true unjoin_players: true cache: true announce: true language: en tld: com.au target: entity_id: - media_player.kitchen - media_player.dining_room - media_player.bedroom ``` -------------------------------- ### chime_tts.say_url Service Call Example Source: https://github.com/nimroddolev/chime_tts/wiki/chime_tts.say_url Demonstrates how to call the chime_tts.say_url service with basic parameters to get a URL for TTS audio. ```yaml service: chime_tts.say_url data: chime_path: toast message: May I have your attention, please? tts_platform: google_translate language: en tld: com.au ``` -------------------------------- ### chime_tts.say_url Service Result Example Source: https://github.com/nimroddolev/chime_tts/wiki/chime_tts.say_url Shows the expected JSON response from the chime_tts.say_url service, including the audio file URL and duration. ```json { "url": https://{YOUR-HOME-ASSISTANT-ADDRESS}:8123/local/chime_tts/ftc_c0jb.mp3 "duration": 3.02 } ``` -------------------------------- ### Using Delay Segment Source: https://github.com/nimroddolev/chime_tts/wiki/chime_tts.say Add delays within messages for dramatic effect or repetition. This example demonstrates a 1-second delay. ```yaml service: chime_tts.say target: entity_id: media_player.kitchen_speaker data: chime_path: toast end_chime_path: tada tts_platform: google_translate cache: false language: en message: - type: tts message: Hey, do you hear that? Just listen. - type: delay duration: 1000 - type: tts message: Yep, sounds like clothes waiting to be moved to the dryer ``` -------------------------------- ### TTS Audio with Pre-Chime Source: https://github.com/nimroddolev/chime_tts/wiki/chime_tts.say Play a chime before the TTS message using the 'chime_path' parameter. This example uses the built-in 'tada' chime. ```yaml service: chime_tts.say target: entity_id: - media_player.living_room data: tts_platform: google_translate message: Hello world! chime_path: tada ``` -------------------------------- ### Advanced Message Segments Example Source: https://github.com/nimroddolev/chime_tts/wiki/chime_tts.say Demonstrates using a sequence of tts, chime, and delay segments within the message parameter to create a complex audio output. This allows for mixing TTS messages in different languages with chimes and delays. ```yaml service: chime_tts.say target: entity_id: media_player.kitchen_speaker data: chime_path: chord end_chime_path: tada offset: 0 tts_platform: google_translate language: en message: - type: tts message: Greetings friend! tts_platform: amazon_polly - type: chime path: bells_2 - type: tts message: Hola amigo! language: es options: tld: es offset: 500 - type: delay length: 1000 - type: tts message: G'day mate! cache: true tts_playback_speed: 115 options: tld: com.au ``` -------------------------------- ### TTS Audio with Pre and Post Chimes Source: https://github.com/nimroddolev/chime_tts/wiki/chime_tts.say Combine 'chime_path' and 'end_chime_path' to play chimes both before and after the TTS message. This example uses a 'drumroll' chime and a custom sound file. ```yaml service: chime_tts.say target: entity_id: - media_player.living_room data: tts_platform: google_translate message: Hello world! chime_path: drumroll end_chime_path: /media/sounds/doorbell.mp3 ``` -------------------------------- ### Simultaneous Multi-Speaker Announcement Source: https://github.com/nimroddolev/chime_tts/wiki/chime_tts.say Use 'join_players: true' and 'unjoin_players: true' to play TTS announcements across multiple speakers simultaneously and then unjoin them. This example uses Amazon Polly. ```yaml service: chime_tts.say data: chime_path: tada message: The washing's done! tts_platform: amazon_polly join_players: true unjoin_players: true target: entity_id: - media_player.kitchen - media_player.dining_room - media_player.bedroom ``` -------------------------------- ### chime_tts.say_url Service Call Source: https://github.com/nimroddolev/chime_tts/wiki/chime_tts.say_url This snippet demonstrates how to call the chime_tts.say_url service to get a URL for a generated MP3 audio file and its duration. It accepts parameters similar to the chime_tts.say service, excluding audio playback parameters. ```APIDOC ## chime_tts.say_url Service ### Description Returns a publicly accessible URL to the MP3 file generated by the `chime_tts.say` service, along with the generated MP3's duration. ### Service Call ```yaml service: chime_tts.say_url data: chime_path: toast message: May I have your attention, please? tts_platform: google_translate language: en tld: com.au ``` ### Result ```json { "url": "https://{YOUR-HOME-ASSISTANT-ADDRESS}:8123/local/chime_tts/ftc_c0jb.mp3", "duration": 3.02 } ``` ### Parameters Accepts the same parameters as the `chime_tts.say` service, excluding audio playback parameters. Refer to the [documentation for the `chime_tts.say` service](https://github.com/nimroddolev/chime_tts/wiki/chime_tts.say) for detailed parameter information. ### Use Cases Useful for playing Chime TTS audio on media players such as Alexa speakers, often in conjunction with notification services. ``` -------------------------------- ### TTS Audio with Increased Playback Speed Source: https://github.com/nimroddolev/chime_tts/wiki/chime_tts.say Increase the TTS audio playback speed using the 'tts_playback_speed' parameter. This example sets the speed to 120% and uses the Amazon Polly TTS platform. ```yaml service: chime_tts.say data: chime_path: tada message: The washing's done! tts_platform: amazon_polly tts_playback_speed: 120 target: entity_id: - media_player.kitchen - media_player.dining_room ``` -------------------------------- ### TTS Segment Parameter Overriding Example Source: https://github.com/nimroddolev/chime_tts/wiki/chime_tts.say Illustrates how parameters defined within individual TTS segments override the main service call parameters. This allows for localized TTS messages, different speech rates, and caching strategies for specific parts of a message. ```yaml service: chime_tts.say target: entity_id: media_player.kitchen_speaker data: chime_path: classical end_chime_path: marimba tts_platform: google_translate cache: false language: en message: # Overrides the cache parameter to true - type: tts message: May I please have your attention? cache: true # Adds a 3 second delay before the TTS message and overrides the domain accent to the UK - type: tts offset: 3000 message: It is officially time to move the washing to the dryer options: tld: co.uk # Overrides the language to Spanish with the domain accent of Spain, and sets the speech rate to 115% - type: tts message: VĂ¡monos! language: es options: tld: es tts_playback_speed: 115 # Overrides the TTS platform to Amazon Polly - type: tts message: Let's go! tts_platform: amazon_polly ``` -------------------------------- ### Alexa Speaker Integration Sequence Source: https://github.com/nimroddolev/chime_tts/wiki/chime_tts.say_url This sequence shows how to use chime_tts.say_url to generate an Alexa-compatible MP3 and then play it on an Alexa speaker using the notify.alexa_media service. ```APIDOC ## Alexa Speakers Integration ### Description This sequence demonstrates how to generate an MP3 file suitable for Alexa playback using `chime_tts.say_url` with the `audio_conversion` parameter set to "Alexa", and then play this MP3 on an Alexa speaker via the `notify.alexa_media` service. ### Sequence Example ```yaml sequence: - service: chime_tts.say_url response_variable: chime_tts data: message: May I have your attention, please? tts_platform: google_translate audio_conversion: Alexa language: en chime_path: toast tld: com.au - service: notify.alexa_media data: message: "