\duncan3dc\SpeakerTextToSpeech

Convert a string of a text to spoken word audio.

Summary

Methods
Properties
Constants
__construct()
getAudioData()
generateFilename()
save()
getFile()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$text
$provider
$data
N/A

Properties

$text

$text : string

Type

string — The text to convert.

$data

$data : string

Type

string — The audio data.

Methods

getAudioData()

getAudioData() : string

Get the audio for this text.

Returns

string —

The audio data

generateFilename()

generateFilename() : string

Generate the filename to be used for this text.

Returns

string

save()

save(string  $filename) : $this

Create an audio file on the filesystem.

Parameters

string $filename

The filename to write to

Returns

$this

getFile()

getFile(string  $path = null) : string

Store the audio file on the filesystem.

This function uses caching so if the file already exists a call to the text-to-speech service is not made.

Parameters

string $path

The path to the directory to store the file in

Returns

string —

The full path and filename