https://github.com/ex-azure/ex_azure_speech
https://github.com/ex-azure/ex_azure_speech
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ex-azure/ex_azure_speech
- Owner: ex-azure
- License: mit
- Created: 2024-03-26T17:39:09.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-08-06T03:07:08.000Z (8 months ago)
- Last Synced: 2024-09-16T17:42:42.809Z (7 months ago)
- Language: Elixir
- Size: 580 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-elixir - ex_azure_speech - An Elixir SDK implementation for the Microsoft Azure Speech Service. (Miscellaneous)
README
# ExAzureSpeech
[](https://hex.pm/packages/ex_azure_speech)
[](https://github.com/YgorCastor/ex_azure_speech/actions/workflows/build_and_test.yaml)The non-official Elixir implementation for Azure Cognitive Services Speech SDK. This project aims to provide all the functionalities described in the [official speech sdk](https://learn.microsoft.com/en-gb/azure/ai-services/speech-service/) for Elixir Projects.
## Getting Started
To use the Elixir Speech SDK you first need to add the dependency in your `mix.exs` file.
```elixir
def deps do
[
{:ex_azure_speech, "~> 0.1.0"}
]
end
```Optionally, you can add the following configuration to your `config.exs` file, to globally configure all the SDK basic settings.
```elixir
config :ex_azure_speech,
region: "westeurope",
language: "en-US",
auth_key: "YOUR_AZURE_SUBSCRIPTION_KEY"
```## Implemented Modules
### Speech-to-Text with Pronunciation Assessment
To configure the speech-to-text module, you need to add the following module to your supervision tree.
```elixir
children = [
ExAzureSpeech.SpeechToText.Recognizer
]Supervisor.start_link(children, strategy: :one_for_one)
```#### Example
```elixir
File.stream!("test.wav") |> SpeechToText.recognize_once(){:ok,
[%ExAzureSpeech.SpeechToText.Responses.SpeechPhrase{
channel: 0,
display_text: "My voice is my passport verify me.",
duration: 27600000,
id: "ada609c747614c118ac9df6545118646",
n_best: nil,
offset: 7300000,
primary_language: nil,
recognition_status: "Success",
speaker_id: nil
}]}
```### Text-to-Speech
To configure the text-to-speech module, you need to add the following module to your supervision tree.
```elixir
children = [
ExAzureSpeech.TextToSpeech.Synthesizer
]Supervisor.start_link(children, strategy: :one_for_one)
```#### Example
```elixir
{:ok, stream} = TextToSpeech.speak_text("Hello. World.", "en-US-AriaNeural", "en-US"){:ok, #Function<52.48886818/2 in Stream.resource/3>}
stream
|> Stream.into(File.stream!("hello_world.wav"))
|> Stream.run()
```## Readiness
This library is still in continuous development, so contracts and APIs may change considerably. Please, use it at your own risk.
## Roadmap
- ~~Text-to-Speech~~
- Translation
- Speech Intent
- Avatars