Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the autocomplete-woocommerce-orders domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/386669.cloudwaysapps.com/cqygqfjbxm/public_html/wp-includes/functions.php on line 6121

Deprecated: Creation of dynamic property DocuPress_Admin::$plugin_name is deprecated in /home/386669.cloudwaysapps.com/cqygqfjbxm/public_html/wp-content/plugins/docupress/admin/class-docupress-admin.php on line 53

Deprecated: Creation of dynamic property DocuPress_Admin::$version is deprecated in /home/386669.cloudwaysapps.com/cqygqfjbxm/public_html/wp-content/plugins/docupress/admin/class-docupress-admin.php on line 54

Deprecated: Creation of dynamic property DocuPress_Public::$plugin_name is deprecated in /home/386669.cloudwaysapps.com/cqygqfjbxm/public_html/wp-content/plugins/docupress/public/class-docupress-public.php on line 46

Deprecated: Creation of dynamic property DocuPress_Public::$version is deprecated in /home/386669.cloudwaysapps.com/cqygqfjbxm/public_html/wp-content/plugins/docupress/public/class-docupress-public.php on line 47

Deprecated: Return type of PasswordsEvolved\DependencyInjection\Container::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/386669.cloudwaysapps.com/cqygqfjbxm/public_html/wp-content/plugins/passwords-evolved/src/DependencyInjection/Container.php on line 83

Deprecated: Return type of PasswordsEvolved\DependencyInjection\Container::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/386669.cloudwaysapps.com/cqygqfjbxm/public_html/wp-content/plugins/passwords-evolved/src/DependencyInjection/Container.php on line 91

Deprecated: Return type of PasswordsEvolved\DependencyInjection\Container::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/386669.cloudwaysapps.com/cqygqfjbxm/public_html/wp-content/plugins/passwords-evolved/src/DependencyInjection/Container.php on line 105

Deprecated: Return type of PasswordsEvolved\DependencyInjection\Container::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/386669.cloudwaysapps.com/cqygqfjbxm/public_html/wp-content/plugins/passwords-evolved/src/DependencyInjection/Container.php on line 117

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the stop-user-enumeration domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/386669.cloudwaysapps.com/cqygqfjbxm/public_html/wp-includes/functions.php on line 6121
intellipress_generator_tts_voices – IntelliPress

intellipress_generator_tts_voices

2 minutes, 28 seconds

Step 1: Understanding the Function

The intellipress_generator_tts_voices() function is a helper function that returns an array of predefined text-to-speech (TTS) voices. These voices represent different synthesized speech options available in the system. The function applies the apply_filters() function, allowing developers to modify or extend the array of voices dynamically.

Step 2: Hook into the Filter

To customize the TTS voices, you can hook into the intellipress_generator_tts_voices filter using the add_filter() function. This filter enables you to modify the voices array before it is returned by the intellipress_generator_tts_voices() function.

Here’s an example of how you can hook into the filter and add your own custom TTS voice:

function my_custom_tts_voices( $voices ) {
// Add your custom TTS voice
$voices[] = 'crystal';
return $voices;
}
add_filter( 'intellipress_generator_tts_voices', 'my_custom_tts_voices' );

In the above code, we define a new function called my_custom_tts_voices() that takes the $voices array as a parameter. Inside the function, we use the array push syntax ( [] ) to add a custom TTS voice called ‘crystal’ to the array. Finally, we return the modified array.

Step 3: Customize and Extend

You can further customize and extend the intellipress_generator_tts_voices() function by adding more voices or modifying existing ones. Simply use the array push syntax ( [] ) to add new voices or modify existing ones.

Here’s an example of how you can add multiple custom TTS voices:

function my_custom_tts_voices( $voices ) {
// Add custom TTS voices
$voices[] = 'horizon';
$voices[] = 'luna';
return $voices;
}
add_filter( 'intellipress_generator_tts_voices', 'my_custom_tts_voices' );

In the above code, we added two custom TTS voices called ‘horizon’ and ‘luna’ to the array.

Step 4: TTS Voices in IntelliPress

IntelliPress integrates with OpenAI’s text-to-speech (TTS) capabilities, allowing you to choose from a selection of high-quality AI-generated voices for content narration.

By default, the following voices are available in IntelliPress:

  • Alloy
  • Ash
  • Coral
  • Echo
  • Fable
  • Onyx
  • Nova
  • Sage
  • Shimmer

These voices offer different tonal and expressive qualities, making them suitable for various use cases such as podcasts, audiobooks, and automated customer interactions.

To modify the list of available TTS voices, you can use the intellipress_generator_tts_voices filter as demonstrated in the previous steps.

Step 5: Enjoy the Customization

After adding the custom code to your project, you can use the intellipress_generator_tts_voices() function to retrieve the modified array of TTS voices. The function will now include the default voices along with any custom voices you added.

$tts_voices = intellipress_generator_tts_voices();
foreach ( $tts_voices as $voice ) {
echo $voice . '<br>';
}

In the above example, we retrieve the TTS voices using the intellipress_generator_tts_voices() function and then loop through the array to display each voice. Feel free to adapt this code to suit your specific needs.

And there you have it! You now know how to customize the intellipress_generator_tts_voices() function to include your own TTS voices.

Was this article helpful?