Audio Control — Anki Add-on
An Audacity-inspired audio player for Anki with waveform visualization, region selection, bookmarks, and auto-repeat — designed for language learners who need to replay specific audio segments.
✨ Features
🌊 Waveform Visualization
- Real-time waveform display computed from your audio files
- Gradient rendering with played/unplayed distinction
- Time ruler with tick marks at the bottom
- Hover tooltip shows time at cursor position
- Playback cursor with glow effect
🖱️ Region Selection
- Click and drag on the waveform to select any audio segment
- Selection shows start time, end time, and duration
- Play Selection button plays only the selected region
- Click anywhere on the waveform to seek
🔖 Region Bookmarks
- Save selections as bookmarks — each bookmark stores a start-end range
- Bookmarks are displayed as colored regions on the waveform (B1, B2, B3...)
- Navigate between bookmarks with buttons or keyboard shortcuts
- Delete individual bookmarks or clear all
- Persistent — bookmarks are saved per card and restored automatically
🔄 Auto Repeat
- Toggle repeat mode to loop the current selection or full audio
- Repeat counter shows how many times it has looped
- Works with both full audio and selected regions
⚡ Playback Speed
- Adjustable speed: 0.5x, 0.7x, 0.8x, 1.0x, 1.2x, 1.5x, 2.0x
⌨️ Keyboard Shortcuts
All shortcuts use Shift+Key to avoid conflicts with Anki's built-in shortcuts.
| Shortcut | Action |
|---|---|
| Shift + Space | Play / Pause |
| Shift + S | Stop |
| Shift + R | Toggle Auto-Repeat |
| Shift + B | Save current selection as Bookmark |
| Shift + D | Delete active bookmark |
| Shift + ← | Jump to previous bookmark |
| Shift + → | Jump to next bookmark |
- Restart Anki.
Method 2: Using install.bat (Windows)
- Run
install.bat from the source folder.
- Restart Anki.
🎯 How to Use
Basic Playback
- Open any Anki card that has audio (
[sound:filename.mp3]).
- The audio player with waveform will appear automatically.
- Click the ▶ Play button or press Shift+Space to play.
Selecting a Region
- Click and drag on the waveform to highlight a segment.
- The selection appears as a yellow highlighted area.
- Click ⏩ Play Selection to play only the selected part.
- Enable 🔄 Repeat to loop the selection continuously.
Using Bookmarks
- Select a region you want to remember (drag on waveform).
- Press Shift+B or click 🔖 to save it as a bookmark.
- Bookmarks appear as colored regions (peach, green, purple...).
- Use Shift+←/→ to navigate between bookmarks.
- Press Shift+D or click ❌ to delete the active bookmark.
- Bookmarks are saved permanently — they'll be there next time you review.
Adjusting Speed
- Use the speed dropdown (right side) to slow down or speed up audio.
- Great for catching fast speech at 0.7x, then practicing at 1.0x.
🔧 Configuration
Audio Player Position
By default, the player appears above the card content. To move it below, edit __init__.py line ~469:
# Player on top (default):
return injection + html
# Player on bottom:
return html + injection
Supported Audio Formats
MP3, WAV, OGG, M4A, FLAC, AAC, WebM
🏗️ Technical Details
- No external dependencies — all rendering uses HTML5 Canvas
- Waveform computation — MP3 frames are parsed in Python to extract amplitude data
- Bookmark storage — saved as JSON in the add-on directory
- Compatible with Anki 2.1.x+ and Anki 25.x
- Cross-platform — works on Windows, macOS, and Linux
📄 License
MIT License — free to use, modify, and distribute.