Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@capacitor-community/text-to-speech
Advanced tools
Capacitor plugin for synthesizing speech from text.
@capacitor-community/text-to-speech
Capacitor community plugin for synthesizing speech from text.
Maintainer | GitHub | Social |
---|---|---|
Robin Genz | robingenz | @robin_genz |
npm install @capacitor-community/text-to-speech
npx cap sync
On iOS, no further steps are needed.
On Android, register the plugin in your main activity:
import com.getcapacitor.community.tts.TextToSpeech;
public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Initializes the Bridge
this.init(
savedInstanceState,
new ArrayList<Class<? extends Plugin>>() {
{
// Additional plugins you've installed go here
// Ex: add(TotallyAwesomePlugin.class);
add(TextToSpeech.class);
}
}
);
}
}
No configuration required for this plugin.
Name | Android | iOS | Web |
---|---|---|---|
speak | ✅ | ✅ | ✅ |
stop | ✅ | ✅ | ✅ |
getSupportedLanguages | ✅ | ✅ | ✅ |
openInstall | ✅ | ✅ | ❌ |
setPitchRate | ✅ | ✅ | ❌ |
setSpeechRate | ✅ | ✅ | ❌ |
// Must import the package once to make sure the web support initializes
import '@capacitor-community/text-to-speech';
import { Plugins } from '@capacitor/core';
const { TextToSpeech } = Plugins;
/**
* Platform: Android/iOS/Web
* This method will trigger text to speech engine and play desired text.
* @param text - desired text to play in speech
* locale - supported locale (can be obtained by calling getSupportedLanguages())
* speechRate - speech rate (1.0 is the normal speech rate, lower values slow down the speech, greater values accelerate it)
* pitchRate - pitch rate (1.0 is the normal pitch rate, smaller value lowers the tone and greater value increases it)
* volume - volume of the synthesis (0 - 1)
* voice - index of the voice (can be obtained by calling getSupportedVoices()) (Android/Web Only)
* @returns void
*/
TextToSpeech.speak({
text: 'This is a sample text.',
locale: 'en_US',
speechRate: 1.0,
pitchRate: 1,
volume: 1.0,
voice: 10,
category: 'ambient',
});
/**
* Platform: Android/iOS/Web
* This method will stop the engine if it's in the middle of playback.
* @param none
* @returns void
*/
TextToSpeech.stop();
/**
* Platform: Android/iOS/Web
* This method will return list of supported languages.
* @param none
* @returns languages - list of available languages
*/
TextToSpeech.getSupportedLanguages();
/**
* Platform: Android/iOS/Web
* This method will return list of supported voices.
* @param none
* @returns voices - list of available voices
*/
TextToSpeech.getSupportedVoices();
/**
* Platform: Android/iOS
* This method will trigger the platform TextToSpeech engine to start the activity that installs the resource files on the device that are required for TTS to be operational.
* @param none
* @returns void
*/
TextToSpeech.openInstall();
/**
* * Platform: Android/iOS
* This method will change the pitch rate while the text is being played.
* @param pitchRate - rate of the pitch (1.0 is the normal pitch, lower values lower the tone of the synthesized voice, greater values increase it)
* @returns void
*/
TextToSpeech.setPitchRate({
pitchRate: 1.5,
});
/**
* * Platform: Android/iOS
* This method will change the speech rate while the text is being played.
* @param speechRate - speech rate (1.0 is the normal speech rate, lower values slow down the speech, greater values accelerate it)
* @returns void
*/
TextToSpeech.setSpeechRate({
speechRate: 0.5,
});
See CHANGELOG.md.
See LICENSE.
FAQs
Capacitor plugin for synthesizing speech from text.
The npm package @capacitor-community/text-to-speech receives a total of 2,383 weekly downloads. As such, @capacitor-community/text-to-speech popularity was classified as popular.
We found that @capacitor-community/text-to-speech demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.