Skip to main content

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 and tqdm for real-time progress tracking.
  • 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\](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.

Basic Sync

Sync notes from a specific deck using default settings:

azv --query "deck:MyEnglishDeck" --source "Front" --target "AudioField"

Advanced Usage

Override the default voice and limit the number of notes for a test run:

azv -q "tag:new_words" -s "Word" -t "Pronunciation" -v "zh-CN-YunyangNeural" --limit 10

Options

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

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. 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

ankiazvox-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ankiazvox-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file ankiazvox-0.1.0.tar.gz.

File metadata

  • Download URL: ankiazvox-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.13 Darwin/25.2.0

File hashes

Hashes for ankiazvox-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7fabf02bc8af0f65e7d0d6f94bf334adaad6beab66305ea3b2e144715ddd1b36
MD5 373073d94941443705a0de199d4228f0
BLAKE2b-256 ac53b553aab16b6e8740342c5895ccd99e630d09c86b2216f7ae8b1d94c8ccbf

See more details on using hashes here.

File details

Details for the file ankiazvox-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ankiazvox-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 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

Hashes for ankiazvox-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 606d27862c18701198310c12ce05aa4e651bb481b899f38c47a4a0409dae2be7
MD5 ca2375e54a9015489782abafdf886066
BLAKE2b-256 8d3db199c1bf630076e3d08235b637e9b40016913fe724c72149c750d4e37968

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page