Skip to content

Commit

Permalink
release: v6.0.0
Browse files Browse the repository at this point in the history
Close #78
Close #71
Close #66
  • Loading branch information
kxxt committed Jun 29, 2023
1 parent 7fe038a commit 71764e9
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 5 deletions.
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,63 @@
# aspeak Changelog

# v6.0.0

aspeak v6.0 is finally released🎉🎉🎉! This is a major release with some breaking changes. Please read the following carefully.

## Generic

- GitHub branches: The main branch has been deleted. The default branch is now `v5` and it will change to `v6` when v6 is released.
- Upgrade dependencies (Solves security alert #77)
- Internal refactor

## For CLI users

- Now the CLI uses the REST API instead of the WebSocket API by default.
- You can use the `--mode websocket` flag to use the WebSocket API.
- You can also set the `mode` field to `websocket` in the auth section in your profile to use the WebSocket API by default.
- When the TTS API returns empty audio, aspeak no longer reports an cryptic "Unrecognized format" error.
- It will now report a warning in this case: "Got empty audio buffer, nothing to play"
- Now the voice listing command no longer fails with this API endpoint: https://speech.platform.bing.com/consumer/speech/synthesize/readaloud/voices/list
- Performance improvement: eliminate unnecessary memory copy

## For Rust crate users

There are a lots of breaking changes:

- Some fields of the `Voice` struct is now optional.
- We now uses an [modular approach for error handling](https://sabrinajewson.org/blog/errors) instead of using a big enum for all errors. (#66)
- Now there are two synthesizers: `RestSynthesizer` for the REST API and `WebSocketSynthesizer` for the WebSocket API. (#71)
- The REST synthesizer has two extra methods that returns the underlying `Bytes` object instead of `Vec<u8>`.
- There is a `UnifiedSynthesizer` trait that provides a unified interface for both synthesizers.
- Some methods are renamed. For example, `Synthesizer::connect` is now `Synthesizer::connect_websocket`.
- Four new feature flags of this crate:
- `rest-synthesizer`: Enable the `RestSynthesizer` struct.
- `websocket-synthesizer`: Enable the `WebSocketSynthesizer` struct.
- `unified-synthesizer`: Enable the `UnifiedSynthesizer` trait.
- `synthesizers`: Enable all synthesizers.
- `synthesizers` feature are enabled by default.
- Disabling `websocket-synthesizer` feature will save you a bunch of dependencies. (`aspeak.rlib` is ~0.8MB smaller in release mode)
- Improved doc comments.
- Support TLS feature flags: By default, this crate uses `native-tls`. To use other TLS implementations, you can use the following feature flags:
- `native-tls-vendored`: Use the vendored version of `native-tls`.
- `rustls-tls-native-roots`
- `rustls-tls-webpki-roots`
- Add 4 examples for quick reference:
- [Simple usage of RestSynthesizer](https://github.com/kxxt/aspeak/blob/v6/examples/03-rest-synthesizer-simple.rs)
- [Simple usage of WebsocketSynthesizer](https://github.com/kxxt/aspeak/blob/v6/examples/04-websocket-synthesizer-simple.rs)
- [Synthesize all txt files in a given directory](https://github.com/kxxt/aspeak/blob/v6/examples/01-synthesize-txt-files.rs)
- [Read-Synthesize-Speak-Loop: Read text from stdin line by line and speak it](https://github.com/kxxt/aspeak/blob/v6/examples/02-rssl.rs)

## For Python binding users

- The `SpeechService` now automatically connect when it is constructed and it is using the websocket API. The `connect` method is removed.
- It now uses the REST API by default.
- New keyword argument for the constructor of `SpeechService`:
- mode: `rest` or `websocket`. Default is `rest`.
- Improved error messages of the python binding
- Enable abi3 wheels so that we do not need to build for every python version.
- Now type hints are provided. You will get better completion in your IDE. (#78)

# v6.0.0-rc.1

Changes after v6.0.0-beta.3:
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 = "6.0.0-rc.1"
version = "6.0.0"
edition = "2021"
authors = ["kxxt <[email protected]>"]
description = "A simple text-to-speech client for Azure TTS API."
Expand Down
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![GitHub stars](https://img.shields.io/github/stars/kxxt/aspeak)](https://github.com/kxxt/aspeak/stargazers)
[![GitHub issues](https://img.shields.io/github/issues/kxxt/aspeak)](https://github.com/kxxt/aspeak/issues)
[![GitHub forks](https://img.shields.io/github/forks/kxxt/aspeak)](https://github.com/kxxt/aspeak/network)
[![GitHub license](https://img.shields.io/github/license/kxxt/aspeak)](https://github.com/kxxt/aspeak/blob/main/LICENSE)
[![GitHub license](https://img.shields.io/github/license/kxxt/aspeak)](https://github.com/kxxt/aspeak/blob/v6/LICENSE)

<a href="https://github.com/kxxt/aspeak/graphs/contributors" alt="Contributors">
<img src="https://img.shields.io/github/contributors/kxxt/aspeak" />
Expand All @@ -16,6 +16,9 @@ A simple text-to-speech client for Azure TTS API. :laughing:

## Note

Starting from version 6.0.0, `aspeak` by default uses the RESTful API of Azure TTS. If you want to use the WebSocket API,
you can specify `--mode websocket` when invoking `aspeak` or set `mode = "websocket"` in the `auth` section of your profile.

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

You can sign up for an Azure account and then
Expand Down Expand Up @@ -43,7 +46,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==5.2.0
pip install -U aspeak==6.0.0
```

Now the prebuilt wheels are only available for x86_64 architecture.
Expand Down Expand Up @@ -98,7 +101,7 @@ an official endpoint designated by a region,
run the following command:

```sh
$ aspeak --region <YOUR_REGION> --key <YOUR_SUBSCRIPTION_KEY> text "Hello World"
$ 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`.
Expand Down Expand Up @@ -176,6 +179,9 @@ verbosity = 0
# Alternatively, you can specify the region if you are using official endpoints
# region = "eastus"

# Synthesizer Mode, "rest" or "websocket"
# mode = "rest"

# Azure Subscription Key
# key = "YOUR_KEY"

Expand Down Expand Up @@ -565,3 +571,10 @@ $ cargo add aspeak
```

Then follow the [documentation](https://docs.rs/aspeak) of `aspeak` crate.

There are 4 examples for quick reference:

- [Simple usage of RestSynthesizer](https://github.com/kxxt/aspeak/blob/v6/examples/03-rest-synthesizer-simple.rs)
- [Simple usage of WebsocketSynthesizer](https://github.com/kxxt/aspeak/blob/v6/examples/04-websocket-synthesizer-simple.rs)
- [Synthesize all txt files in a given directory](https://github.com/kxxt/aspeak/blob/v6/examples/01-synthesize-txt-files.rs)
- [Read-Synthesize-Speak-Loop: Read text from stdin line by line and speak it](https://github.com/kxxt/aspeak/blob/v6/examples/02-rssl.rs)

0 comments on commit 71764e9

Please sign in to comment.