Queue Playback
Use PCMQueuePlayer for frame reads, snapshots, skips, and queue control outside Discord.
Use PCMQueuePlayer for frame reads, snapshots, skips, and queue control outside Discord.
Trim silence, normalize loudness, and adapt crossfade timing to track duration and analysis results.
Plan adjacent-track transitions with beat confidence, conservative tempo nudging, and fallback behavior.
Install
Install only the engine by default. Add stream resolution or Discord voice support when your product needs it.
pip install veloura-audio
pip install "veloura-audio[stream]"
pip install "veloura-audio[discord]"
python -c "import veloura; print(veloura.__version__)"
Player API
Enqueue prepared tracks, read PCM frames, inspect snapshots, and prepare the next transition when both tracks are known.
from veloura.audio import AudioTrack, PCMQueuePlayer, transition_preset
config = transition_preset("automix")
player = PCMQueuePlayer(
volume=0.65,
crossfade_seconds=config.base_crossfade_seconds,
)
track = AudioTrack.from_source(
"song-a.mp3",
title="Song A",
duration=180,
)
player.enqueue(track)
frame = player.read_frame()
snapshot = player.snapshot().to_dict()
Selected preset
Balanced transitions for livestreams, Discord queues, and background music.
AutoMix
AutoMix analyzes current outro and next intro beat windows, then applies a pair-specific crossfade, intro trim, and small tempo nudge when confidence is high. If analysis is weak, it keeps the blend short.
Audio Demo
A short demo showing Veloura blending one CC0 music track into another.
The clip was rendered with PCMQueuePlayer and bundled as a
listenable example of the crossfade engine.
Two CC0 music excerpts blended with an equal-power ending transition.
Demo Sources
The public demo is rendered from OpenGameArt tracks listed as CC0. Attribution is optional under CC0, but the sources are shown here for provenance.
By Fupi. Listed as CC0 on OpenGameArt. View source.
By congusbongus. Listed as CC0 on OpenGameArt. View source.
python examples/generate_transition_demo_audio.py
Discord Example
Discord bots can keep their own commands and queues while Veloura handles stream resolution, transition prep, and the voice audio source.
from veloura.audio import CrossfadeAudioSource, resolve_stream_track, transition_preset
config = transition_preset("streamer")
source = CrossfadeAudioSource(crossfade_seconds=config.base_crossfade_seconds)
track = await resolve_stream_track(
"artist song official audio",
transition_config=config,
)
source.enqueue(track)
voice_client.play(source)
Troubleshooting
Run ffmpeg -version. Veloura needs FFmpeg for decoding, analysis, and stream playback.
Install veloura-audio[stream] when resolving YouTube URLs or search queries through yt-dlp.
Install veloura-audio[discord] so discord.py and PyNaCl are available.
Use Cases
Keep CrossfadeAudioSource as the Discord voice adapter while the package handles transition planning.
Run prepared queues through PCM frame output for continuous livestream or station-style playback.
Use PCMQueuePlayer as the audio engine behind desktop, web, or mobile-style queue products.