use PascalKleindienst\LaravelTextToSpeech\Facades\TextToSpeech;
use PascalKleindienst\LaravelTextToSpeech\Source;
// The text is converted to speech and stored in a file (configured in the "audio" config).
TextToSpeech::convert('Hello World!');
// The text is converted to speech and additionallystored in the given file.
TextToSpeech::convert('Hello World!')->save('path/to/file.mp3');
// Store the converted text on a different disk
TextToSpeech::convert('Hello World!')->disk('s3')->save('path/to/file.txt');
// convert text from a file
TextToSpeech::from(Source::File)->convert('path/to/file.txt');
/**
* Change the language and/or voice used for the speech.
* NOTE:
* This will overwrite the language and voice settings in the config file.
* Also the format for the language might be different for each engine, e.g. de vs de-DE
*/
TextToSpeech::language('de-DE')->voice('male')->convert('Hallo Welt!');
// Use the system engine to convert text to speech, needs espeak-ng to be installed
TextToSpeech::engine('system')->convert('Hello System Engine!');
// Use the Google engine to convert text to speech, needs google cloud sdk to be installed
TextToSpeech::engine('google')->convert('Hello Google Engine!');