Skip to content

Commit

Permalink
release: publish v5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kxxt committed Apr 18, 2023
1 parent d9e279d commit 6d2c9a7
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 15 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# aspeak Changelog

# v5.0.0

## Enhancements

- Add support for `--color={auto,always,never}` options. And `aspeak` will also respect the `NO_COLOR` environment variable.
- There is an edge case that `aspeak` will use colored output even if `--color=never` is specified.
This is because `aspeak` uses `clap` to parse command line options. `--color=never` works only if the command line parsing is successful.
So if you specify an invalid option, `aspeak` will print the error message and exit. In this case, `aspeak` will use colored output.
- More documentation for the rust crate.
- Minor performance improvements.
- Now you can specify the custom voice list API url in your profile(field `voice_list_api` in section `auth`).

## Breaking changes

- The default trial endpoint has been removed because it was shutdown by Microsoft. Now you must set up authentication to use `aspeak`.
- The default voice list API url has been removed for the same reason.
- The rust API has been changed.
- `Synthesizer` is now `Send`. Its various `synthesize_*` methods now takes `&mut self` instead of `&self`.
- Now you need to use the builder pattern to create various options like `TextOptions`.
- Fields of the `Voice` struct are now private. You can use the methods to access them.

## Other changes

- The PKGBUILDs for Arch Linux is no longer stored in this repository. You can find them in the [AUR](https://aur.archlinux.org/packages/aspeak).

# v4.3.1

- Fix a bug that caused the `endpoint` and `region` settings in profile to be ineffective.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aspeak"
version = "4.3.1"
version = "5.0.0"
edition = "2021"
authors = ["kxxt <[email protected]>"]
description = "A simple text-to-speech client for Azure TTS API."
Expand Down
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,10 @@

A simple text-to-speech client for Azure TTS API. :laughing:

You can try the Azure TTS API online: https://azure.microsoft.com/en-us/services/cognitive-services/text-to-speech

## Note

Starting from version 4.0.0, `aspeak` is rewritten in rust. The old python version is available at the `python` branch.

By default, we try to use a trial endpoint that doesn't require authentication.
But its availability is not guaranteed and its capability is restricted by Microsoft.

You can sign up for an Azure account and then
[choose a payment plan as needed (or stick to free tier)](https://azure.microsoft.com/en-us/pricing/details/cognitive-services/speech-services/).
The free tier includes a quota of 0.5 million characters per month, free of charge.
Expand All @@ -48,7 +43,7 @@ From v4.1.0, You can install `aspeak-bin` from AUR.
Installing from PyPI will also install the python binding of `aspeak` for you. Check [Library Usage#Python](#Python) for more information on using the python binding.

```bash
pip install -U aspeak==4.3.1
pip install -U aspeak==5.0.0
```

Now the prebuilt wheels are only available for x86_64 architecture.
Expand Down Expand Up @@ -108,6 +103,10 @@ $ aspeak --region <YOUR_REGION> --key <YOUR_SUBSCRIPTION_KEY> text "Hello World

If you are using a custom endpoint, you can use the `--endpoint` option instead of `--region`.

To avoid repetition, you can store your authentication details
in your aspeak profile.
Read the following section for more details.

From v4.3.0, you can let aspeak use a proxy server to connect to the endpoint.
For now, only http and socks5 proxies are supported (no https support yet). For example:

Expand All @@ -118,10 +117,6 @@ $ aspeak --proxy socks5://your_proxy_server:port text "Hello World"

aspeak also respects the `HTTP_PROXY`(or `http_proxy`) environment variable.

To avoid repetition, you can store your authentication details
in your aspeak profile.
Read the following section for more details.

### Configuration

aspeak v4 introduces the concept of profiles.
Expand Down Expand Up @@ -171,7 +166,7 @@ verbosity = 0

[auth]
# Endpoint for TTS
# endpoint = "wss://eastus.api.speech.microsoft.com/cognitiveservices/websocket/v1"
# endpoint = "wss://eastus.tts.speech.microsoft.com/cognitiveservices/websocket/v1"

# Alternatively, you can specify the region if you are using official endpoints
# region = "eastus"
Expand All @@ -188,6 +183,9 @@ verbosity = 0
# Proxy
# proxy = "socks5://127.0.0.1:7890"

# Voice list API url
# voice_list_api = "Custom voice list API url"

#
# Configuration for text subcommand
#
Expand Down Expand Up @@ -231,6 +229,12 @@ If you want to use a profile other than your default profile, you can use the `-
aspeak --profile <PATH_TO_A_PROFILE> text "Hello"
```

If you want to temporarily disable the profile, you can use the `--no-profile` argument:

```sh
aspeak --no-profile --region eastus --key <YOUR_KEY> text "Hello"
```

### Pitch and Rate

- `rate`: The speaking rate of the voice.
Expand All @@ -255,6 +259,8 @@ aspeak --profile <PATH_TO_A_PROFILE> text "Hello"

### Examples

The following examples assume that you have already set up authentication in your profile.

#### Speak "Hello, world!" to default speaker.

```sh
Expand Down Expand Up @@ -481,7 +487,7 @@ $ aspeak text "你好,世界!" -v zh-CN-XiaoxiaoNeural -p=+1st -r=-7% -S lyr

#### Use a custom audio format for output

**Note**: Some audio formats are not supported when you are outputting to speaker.
**Note**: Some audio formats are not supported when outputting to speaker.

```sh
$ aspeak text "Hello World" -F riff-48khz-16bit-mono-pcm -o high-quality.wav
Expand Down Expand Up @@ -509,7 +515,7 @@ When creating a `SpeechService` instance, you can specify the following paramete

- `audio_format`: The audio format of the output audio. Default is `AudioFormat.Riff24KHz16BitMonoPcm`.
- You can get an audio format by providing a container format and a quality level: `AudioFormat("mp3", 2)`.
- `endpoint`: The endpoint of the speech service. We will use a trial endpoint by default.
- `endpoint`: The endpoint of the speech service.
- `region`: Alternatively, you can specify the region of the speech service instead of typing the boring endpoint url.
- `subscription_key`: The subscription key of the speech service.
- `token`: The auth token for the speech service. If you provide a token, the subscription key will be ignored.
Expand Down

0 comments on commit 6d2c9a7

Please sign in to comment.