DocomoTextToSpeech v0.2.1 DocomoTextToSpeech View Source
Elixir client for NTT Docomo TextToSpeech API.
Installation
The package can be installed by adding docomo_text_to_speech
to your list of
dependencies in mix.exs
:
def deps do
[
{:docomo_text_to_speech, "~> 0.2.1"}
]
end
Configuration
Get your API key from docomo Developer support site.
Set the API key to your system environment variable.
export DOCOMO_TEXT_TO_SPEECH_API_KEY="secret"
In your config.exs
, set the api_key
from the system environment variable.
config :docomo_text_to_speech,
api_key: System.get_env("DOCOMO_TEXT_TO_SPEECH_API_KEY")
Usage
iex> DocomoTextToSpeech.run!("エリクサー") |> (&File.write("output.wav", &1)).()
License
DocomoTextToSpeech is licensed under the MIT License.
Link to this section Summary
Functions
Converts text to speech
Link to this section Functions
Link to this function
run(text, speaker_id \\ 1, style_id \\ 1, speech_rate \\ 1.0, power_rate \\ 1.0, voice_type \\ 1.0, audio_file_format \\ 2)
View SourceConverts text to speech
Examples
iex> DocomoTextToSpeech.run "エリクサー"
{:ok,
<<82, 73, 70, 70, 28, 199, 0, 0, 87, 65, 86, 69, 102, 109, 116, 32, 18, 0, 0,
0, 1, 0, 1, 0, 34, 86, 0, 0, 68, 172, 0, 0, 2, 0, 16, 0, 0, 0, 100, 97, 116,
97, 246, 198, 0, 0, 0, 0, ...>>}
Link to this function
run!(text, speaker_id \\ 1, style_id \\ 1, speech_rate \\ 1.0, power_rate \\ 1.0, voice_type \\ 1.0, audio_file_format \\ 2)
View SourceConverts text to speech
Examples
iex> DocomoTextToSpeech.run "エリクサー"
<<82, 73, 70, 70, 28, 199, 0, 0, 87, 65, 86, 69, 102, 109, 116, 32, 18, 0, 0,
0, 1, 0, 1, 0, 34, 86, 0, 0, 68, 172, 0, 0, 2, 0, 16, 0, 0, 0, 100, 97, 116,
97, 246, 198, 0, 0, 0, 0, ...>>