faumaray 818d391022 Update
Signed-off-by: faumaray <faumaray@gmail.com>
2026-07-15 19:50:44 +03:00
2026-07-04 01:54:52 +03:00
2026-07-15 19:50:44 +03:00
2026-07-15 19:50:44 +03:00
2026-07-11 00:47:52 +03:00
2026-07-12 02:57:35 +03:00
2026-07-15 19:50:44 +03:00
2026-07-15 19:50:44 +03:00
2026-07-15 19:50:44 +03:00
2026-07-15 19:50:44 +03:00
2026-02-01 23:09:22 +03:00
2026-07-15 19:50:44 +03:00
2026-07-04 01:50:44 +03:00
2026-07-15 19:50:44 +03:00
2026-07-04 01:50:44 +03:00
2026-07-15 19:50:44 +03:00
2026-07-15 19:50:44 +03:00
2026-07-11 00:47:52 +03:00
2026-07-15 19:50:44 +03:00
2026-07-15 19:50:44 +03:00

Echoion Music Bot

A modern music bot for TeamSpeak 3, featuring YouTube integration, playlist support, and hot-reload capabilities.

Features

  • 🎵 YouTube Integration - Play music directly from YouTube URLs or search queries via a native innertube client (fastest path) with yt-dlp as the resolver/fallback
  • 🎶 Two Catalogs - Search and play from YouTube and Yandex Music (native, full tracks with a Plus token). !play searches both; !pyt/!pya target one. Direct audio URLs / radio streams and other yt-dlp extractors (SoundCloud, Bandcamp, VK, …) also work
  • ⚡ Hedged Resolution - A slow source is raced by the next candidate after 300ms; first success wins
  • 🔁 Gapless Playback & Crossfade - The next track's decoder is pre-warmed while the current one plays; optional crossfade (bot.crossfade)
  • 🔊 Loudness Normalization - Optional slow AGC evens out quiet/loud tracks (features.normalizeLoudness)
  • 📻 Autoplay / Radio Mode - When the queue runs dry, !radio keeps the music going with related tracks from YouTube or Yandex (features.autoplay)
  • 💾 Track Cache - Downloaded audio is reused across plays and restarts (advanced.cache*)
  • ⭐ History & Favorites - !history, !stats, !fav add|list|play backed by SQLite
  • 📋 Playlist Support - Queue management with shuffle, repeat, and skip functionality
  • 🎧 High Quality Audio - 192kHz stereo internal pipeline
  • 🔄 Transactional Updates - Validate a complete daemon/Core/protocol release, checkpoint playback, re-exec, reconnect, and restore playback
  • ⚙️ Configurable - JSON-based configuration system
  • 🔊 TeamSpeak Native - Uses TeamSpeak's native audio system for best quality
  • 🧩 VoidTeamspeak SDK - Native protocol support is an independently consumable modern C++ library rather than an Echoion-internal component
  • 🌐 Public Dashboard - Current playback plus the complete sanitized TeamSpeak channel/client tree, with authenticated administration for admins
  • 🎬 VoidWatch Link - Watch Together is deployed independently from the EchoionWatch repository and linked through web.watchUrl

Building

Requirements

  • C++26 compatible compiler with reflections (GCC 16+)
  • CMake 4.0+
  • Qt6 (for desktop client)
  • FFmpeg (for audio decoding)
  • Boost (system installation preferred; the build vendors one only when absent — mixing a vendored and a system Boost in one process breaks boost.url)
  • OpenSSL, libsodium, Opus, FFmpeg, and Boost development packages

Build Instructions

mkdir build && cd build
cmake ..
cmake --build .

Tests

cmake .. -DBUILD_TESTS=ON
cmake --build . && ctest

The protocol suite covers command escaping/parsing, packet crypto, QuickLZ, identity generation and persistence, and TeamSpeak identity-export import.

Configuration

Copy config.example.json to your config directory:

  • Linux: ~/.config/echoion/config.json
  • Windows: %APPDATA%\echoion\config.json
  • macOS: ~/Library/Application Support/echoion/config.json

Edit the configuration file with your server details:

{
    "server": {
        "address": "your.server.com",
        "port": 9987,
        "nickname": "MusicBot",
        "serverPassword": ""
    }
}

Installation

Standalone daemon

  1. Build the project and install echoiond together with Echoion.ts.
  2. Copy systemd/echoion-standalone.service to your user systemd directory, adjust its paths, and enable it.
  3. On first start, Echoion generates ~/.config/echoion/identity.txt.

To preserve the permissions and UID of an existing TeamSpeak client identity, export it from TeamSpeak's Identity Manager and import it before first start:

echoiond --import-identity identity.ini
# Choose a non-default destination or replace an existing identity explicitly:
echoiond --import-identity identity.ini --identity-path /path/to/identity.txt --force

The identity file contains a private key. Keep both the TeamSpeak export and the converted file private.

Commands

All commands use the configured prefix (default: !)

Command Description Example
!play <query> Play a song or add to queue !play never gonna give you up
!pause Pause playback !pause
!resume Resume playback !resume
!stop Stop playback !stop
!skip Skip current track !skip
!seek <+/-secs> Seek within the track !seek +30
!queue Show current queue !queue
!clear Clear the queue !clear
!shuffle Toggle shuffle mode !shuffle
!repeat Toggle repeat mode !repeat
!volume <0-100> Set volume !volume 50
!nowplaying Show current track !nowplaying
!lyrics Show lyrics for the current track (alias ly) !lyrics
!search <query> Search YouTube + Yandex Music !search daft punk
!youtube <query> Search YouTube only (alias yb, yt) !yb daft punk
!yandex <query> Search Yandex Music only (alias ya) !ya грибы
!soundcloud <query> Search SoundCloud only (alias sc) !sc lofi beats
!psc <query> Play from SoundCloud only (URL or search) !psc flume
!history [n] Recently played tracks !history 15
!stats Playback statistics !stats
!fav add|list|play <n> Manage your favorites !fav play 2
!announce <text> Admin: message all subscribers once !announce New update live!

Architecture

The supported runtime consists of four main components:

  1. EchoionApi - Shared interfaces and types
  2. EchoionCore - Core music playback logic (hot-reloadable)
  3. VoidTeamspeak - Reusable native TeamSpeak SDK-compatible client library
  4. EchoionStandalone - Daemon host and Core API adapter

The legacy TeamSpeak client plugin was removed. TeamSpeak protocol behavior is implemented once in VoidTeamspeak; EchoionStandalone is Echoion's only host adapter.

Watch Together is the independent VoidWatch product in the sibling EchoionWatch repository. Echoion has no Watch runtime, WebSocket session, provider resolver, or extra TeamSpeak identity; it only exposes the configured external link and a temporary /watch redirect.

Audio Flow

query → SourceRouter (innertube → Yandex → direct URL → yt-dlp) → PlaybackEngine
        (dual AudioDecoder, gapless handoff) → Core → Standalone interface
        → VoidTeamspeak → TeamSpeak

Audio is decoded using FFmpeg at 192kHz stereo and emitted in 20ms chunks to TeamSpeak's Opus voice protocol through the bot's single playback engine and visible TeamSpeak identity.

Development

Hot Reload

The core library can be hot-reloaded without disconnecting from the server:

  1. Build the new core: cmake --build . --target EchoionCore
  2. Replace Echoion.ts; the daemon's host watcher reloads it automatically.

Protocol or host changes require a validated daemon re-exec rather than a Core hot reload. Stage both artifacts and atomically publish the watched manifest:

scripts/stage-release.sh "$HOME/echoion/releases" 1.2.3 \
  build/bin/echoiond build/lib/Echoion.ts

The staging command rejects unsafe version names and existing release directories, copies complete artifacts first, calculates SHA-256 hashes, then renames pending-release.json into place. The running daemon validates it in a child process, checkpoints Core state, disconnects cleanly, and re-execs the staged binary.

Adding Commands

To add a new command:

  1. Create a new command class in EchoionCore/src/commands/
  2. Inherit from CommandBase
  3. Register in CommandManager::initialize()

Example:

class MyCommand : public CommandBase {
public:
    MyCommand() : CommandBase("mycommand", "Description") {}
    
    Api::Result<std::string> execute(uint64_t clientId, const std::vector<std::string>& args) override {
        return "Hello, World!";
    }
};

For independently reloadable native extensions, use the trusted plugin ABI instead of compiling commands into Core. See Native plugins.

Packaging and Distribution

Using CPack

The project includes CPack configuration for creating installers:

cd build

# Create tarball
cpack -G TGZ

# Create DEB package (Debian/Ubuntu)
cpack -G DEB

# Create RPM package (Fedora/RHEL)
cpack -G RPM

# Create ZIP (Windows)
cpack -G ZIP

# Create NSIS installer (Windows)
cpack -G NSIS

Static Linking

For a standalone distribution without external dependencies:

cmake .. -DECHOION_STATIC_LINK=ON
cmake --build .

Note: Some dependencies (Qt6, FFmpeg) may still require bundling. See packaging/README.md for detailed instructions.

CMake Package Support

The project uses PackageProject.cmake to export CMake targets:

find_package(EchoionCore REQUIRED)
target_link_libraries(myapp PRIVATE Echoion::Core)

License

MIT License - See LICENSE file for details

Credits

  • TeamSpeak Systems GmbH for the TeamSpeak SDK
  • FFmpeg team for audio decoding
  • Glaze library for JSON handling
  • PackageProject.cmake for CMake packaging
S
Description
No description provided
Readme
59 MiB
0 Stars 3 Watchers 0 Forks
Echoion 2.0.1
Latest
2026-08-02 01:03:47 +00:00
Languages
Shell 44.6%
Python 44.5%
CMake 8.7%
Dockerfile 1.4%
C++ 0.8%