A CLI tool to synchronize Anki notes with high-quality Azure TTS audio.
Project description
ankiazvox
ankiazvox is a professional CLI tool designed to synchronize Anki notes with high-quality neural audio powered by Azure Cognitive Services. It automates the process of fetching text, generating speech, and updating your Anki cards.
✨ Features
- Neural TTS: Uses Azure's state-of-the-art Neural voices for natural, human-like speech.
- Seamless Integration: Automatically uploads audio to Anki's media folder and updates the [sound:...] tags via AnkiConnect.
- Batch Processing: Efficiently processes multiple notes using a single query.
- Flexible CLI: Built with Click for a smooth command-line experience with support for subcommands.
- Voice Explorer: Built-in command to list and filter available Azure voices.
- Smart Querying: Supports the full range of Anki's search syntax.
🚀 Installation
1. Prerequisites
- Anki Desktop with the AnkiConnect add-on installed.
- An Azure Speech Service subscription (Key and Region).
2. Install via pip (Recommended)
The easiest way to get started is to install directly from PyPI:
pip install ankiazvox
3. Install from Source (For Developers)
If you want to contribute or use the latest development version:
git clone \[https://github.com/ericxu131/ankiazvox.git\](https://github.com/ericxu131/ankiazvox.git)
cd ankiazvox
pip install .
⚙️ Configuration
Create a .env file in your working directory with your credentials:
# AnkiConnect Settings
ANKI_CONNECT_URL=http://127.0.0.1:8765
# Azure Speech Settings
AZURE_SPEECH_KEY=your_azure_api_key
AZURE_SPEECH_REGION=your_service_region (e.g., eastus)
# Default Voice Configuration
DEFAULT_VOICE=en-US-AvaMultilingualNeural
🛠 Usage
Once installed, you can use the azv (alias) or ankiazvox command.
1. Synchronize Audio (sync)
Sync notes from a specific deck using default settings:
azv sync --query "deck:MyEnglishDeck" --source "Front" --target "AudioField"
Override the default voice and limit the number of notes for a test run:
azv sync -q "tag:new_words" -s "Word" -t "Pronunciation" -v "zh-CN-YunyangNeural" --limit 10
| Option | Short | Description |
|---|---|---|
| --query | -q | Anki search query (e.g., deck:Default, tag:marked) |
| --source | -s | The field name containing the text to be synthesized |
| --target | -t | The field name where the [sound:...] tag will be stored |
| --voice | -v | Overrides the default Azure voice defined in .env |
| --limit | Max number of notes to process in this run | |
| --temp-dir | Custom directory for temporary audio files | |
| --env | Path to a specific .env file |
2. List Voices (list-voices)
List all available Azure TTS voices:
azv list-voices
Filter voices by locale (e.g., Chinese or British English):
azv list-voices --locale zh-CN
azv list-voices -l en-GB
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the Project
- Create your Feature Branch (git checkout -b feature/AmazingFeature)
- Commit your Changes (git commit -m 'Add some AmazingFeature')
- Push to the Branch (git push origin feature/AmazingFeature)
- Open a Pull Request
📄 License
Distributed under the MIT License. See LICENSE for more information.
👤 Author
Eric Xu - xulihua2006@gmail.com
Project Link: https://github.com/ericxu131/ankiazvox
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ankiazvox-0.2.0.tar.gz.
File metadata
- Download URL: ankiazvox-0.2.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.11.13 Darwin/25.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab2a1df2d17f9837142e94367829a8a171408415012ffa521122432e3f19236b
|
|
| MD5 |
53863183d1fcdd3e2c7557c1139cd2e1
|
|
| BLAKE2b-256 |
53f15bba3f8cec9a030aac2162b5fae1b72d00c8000c847289d33c964120d948
|
File details
Details for the file ankiazvox-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ankiazvox-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.11.13 Darwin/25.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc5009bd609689c87711e2dedc1a00c523b995ad58ae69b5e11944544988c18e
|
|
| MD5 |
b5f8f0b609113b192f5a3e98f8c0c2e9
|
|
| BLAKE2b-256 |
b3beffb6d1e303506be69d19043a39ec2d04d012c6793dbbc870468bac2a2566
|