Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dom96/texttospeech
A Nim client for the Google Cloud Text to Speech API.
https://github.com/dom96/texttospeech
api-client google-cloud nim text-to-speech
Last synced: 28 days ago
JSON representation
A Nim client for the Google Cloud Text to Speech API.
- Host: GitHub
- URL: https://github.com/dom96/texttospeech
- Owner: dom96
- Created: 2018-07-30T21:14:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-13T20:07:07.000Z (over 6 years ago)
- Last Synced: 2024-10-25T09:21:17.460Z (3 months ago)
- Topics: api-client, google-cloud, nim, text-to-speech
- Language: Nim
- Homepage:
- Size: 4.88 KB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# texttospeech
**texttospeech** implements a
[Google Cloud Text to Speech API](https://cloud.google.com/text-to-speech/)
client.**[API Documentation](https://nimble.directory/docs/texttospeech)** ·
**[GitHub Repo](https://github.com/dom96/texttospeech)**## Installation
Add this to your application's .nimble file:
```nim
requires "texttospeech"
```or to install globally run:
```
nimble install texttospeech
```## Usage
Follow the "Before you begin" steps in this document:
https://cloud.google.com/text-to-speech/docs/quickstart-protocol. Ensure that
the ``gcloud`` utility is in your PATH.You may then compile and run the following:
```nim
import os, optionsimport texttospeech
# Initialise the client:
let client = newTextToSpeechClient()# Synthesize a some text:
let filename = client.synthesizeToFolder("Hello World!", os.getCurrentDir())
echo("Saved in ", filename) # Open the file in your favourite music player.# Modifying the options:
echo client.synthesizeToFolder(
"Nim is the best programming language!",
os.getCurrentDir(),
voice=initVoiceSelectionParams(name=some("en-GB-Wavenet-A")),
audioConfig=initAudioConfig(audioEncoding=OGG_OPUS, pitch = -5)
)
```## Contributing
1. Fork it ( https://github.com/dom96/texttospeech/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## License
MIT