General Questions
What is Symphonia?
What is Symphonia?
- 100% safe Rust
- No unsafe code
- Minimal dependencies
- Fast performance comparable to FFmpeg
- Gapless playback support
- Comprehensive format and codec support
Why choose Symphonia over FFmpeg or other libraries?
Why choose Symphonia over FFmpeg or other libraries?
- Pure Rust: No C dependencies, easier integration, better safety guarantees
- Memory Safety: No segfaults or buffer overflows due to Rust’s ownership system
- Performance: Competitive with or faster than FFmpeg for many codecs
- Minimal Dependencies: Smaller binary size and easier deployment
- WASM Ready: Can be compiled to WebAssembly (planned feature)
- Easy Integration: Native Cargo support, no build scripts for C libraries
- Need video decoding (Symphonia is audio-only)
- Need encoding support (Symphonia only decodes)
- Require codecs not yet supported by Symphonia
- Need extensive format support beyond what Symphonia offers
Is Symphonia stable and production-ready?
Is Symphonia stable and production-ready?
- Excellent test coverage
- Comprehensive fuzzing to prevent crashes
- Several codecs with “Excellent” status (FLAC, MP3, Vorbis, PCM, Wave)
- Active maintenance and bug fixes
- Clear semantic versioning
What does 'pure Rust' mean?
What does 'pure Rust' mean?
- No need to link against C libraries
- No FFI (Foreign Function Interface) overhead
- Cross-compilation is easier
- Better security through memory safety
- Simpler build process
What license is Symphonia released under?
What license is Symphonia released under?
- Allows commercial use
- Allows modification
- Allows distribution
- Requires source disclosure of modifications to Symphonia files
- Allows linking with proprietary code
- Is compatible with GPL and many other licenses
Usage Questions
How do I get started with Symphonia?
How do I get started with Symphonia?
- Add Symphonia to your
Cargo.toml:
- Follow the basic decoding pattern:
How do I enable support for specific codecs or formats?
How do I enable support for specific codecs or formats?
Cargo.toml:How do I play decoded audio?
How do I play decoded audio?
- CPAL - Cross-platform audio I/O (recommended)
- rodio - Higher-level audio playback (uses CPAL internally)
- SDL2 - Multimedia library with audio support
Does Symphonia support seeking?
Does Symphonia support seeking?
SeekMode::Accurate- Seeks to exact position (may be slower)SeekMode::Coarse- Seeks close to position (faster)
How do I read metadata and tags?
How do I read metadata and tags?
Can I use Symphonia with async/await?
Can I use Symphonia with async/await?
- Symphonia’s core API is synchronous
- You can wrap file I/O in async tasks
- Decoding itself is CPU-bound, not I/O-bound
MediaSource that bridges async I/O to Symphonia’s synchronous Read trait.Performance Questions
How does Symphonia's performance compare to FFmpeg?
How does Symphonia's performance compare to FFmpeg?
- FLAC: 29-49% faster
- MP1/MP2: 40-55% faster
- ALAC: 19-27% faster
- MP3: Comparable to 19% faster
- AAC: 10-27% slower
- Vorbis: 5-24% slower (varies by platform)
How can I optimize Symphonia's performance?
How can I optimize Symphonia's performance?
- Enable SIMD optimizations:
- Use target-specific optimizations:
- Use the latest Rust compiler:
- Consider Profile-Guided Optimization (PGO):
Does Symphonia support multi-threaded decoding?
Does Symphonia support multi-threaded decoding?
- Decode multiple files in parallel using separate decoder instances
- Use a thread pool for batch processing
- Run decoding in a separate thread from audio output
What are SIMD optimizations and should I enable them?
What are SIMD optimizations and should I enable them?
opt-simd-sse- x86/x86-64 SSE instructionsopt-simd-avx- x86-64 AVX instructionsopt-simd-neon- ARM Neon instructionsopt-simd- All appropriate for target platform
- Yes if performance is critical
- Yes if you’re building for known hardware
- Consider carefully if building for diverse hardware
- Note: Adds
rustfftdependency
Platform & Compatibility
What platforms does Symphonia support?
What platforms does Symphonia support?
- Desktop: Windows, macOS, Linux, BSD
- Mobile: Android, iOS
- Embedded: ARM Cortex-M, RISC-V (with appropriate allocator)
- Web: WebAssembly (WASM) - experimental
- Rust 1.53.0 or later
- Standard library (no_std support is limited)
Can I use Symphonia in embedded systems?
Can I use Symphonia in embedded systems?
- Sufficient memory for audio buffers
- Allocator for dynamic memory (decoder state)
- Rust standard library or appropriate alternatives
- Some formats (MP3, AAC) require significant memory
- Real-time decoding needs sufficient CPU performance
- Consider using simpler codecs (ADPCM, PCM) on resource-constrained devices
- ADPCM - Low complexity
- PCM - Minimal processing
- FLAC - If CPU allows (efficient lossless)
Does Symphonia work with WebAssembly?
Does Symphonia work with WebAssembly?
- Core library compiles to WASM
- Basic decoding works in WASM environments
- Official WASM API is planned for future release
- No official high-level WASM bindings yet
- File I/O needs WASM-specific implementations
- Performance may vary vs native code
What's the minimum Rust version required?
What's the minimum Rust version required?
Feature Support
Does Symphonia support gapless playback?
Does Symphonia support gapless playback?
- AIFF
- OGG
- Wave
- ADPCM
- ALAC
- FLAC
- MP3
- PCM
- Vorbis
Can Symphonia encode audio?
Can Symphonia encode audio?
- Use codec-specific crates (e.g.,
opus,vorbis_encoder) - Consider FFmpeg bindings if you need comprehensive encoding support
- Wait for potential future Symphonia encoding support (not currently planned)
Does Symphonia support video?
Does Symphonia support video?
- Skip video streams in containers (MP4, MKV)
- Extract audio tracks from video files
- Read metadata and cover art
- FFmpeg bindings
- Native Rust video libraries (limited availability)
What sample formats does Symphonia output?
What sample formats does Symphonia output?
- 16-bit signed integer (i16)
- 24-bit signed integer (i32)
- 32-bit signed integer (i32)
- 32-bit floating point (f32)
- 64-bit floating point (f64)
SampleBuffer:Can I decode audio from memory instead of files?
Can I decode audio from memory instead of files?
Cursor or implement MediaSource:MediaSource for network streams, encrypted sources, or other custom I/O.Troubleshooting
My audio file won't decode - what's wrong?
My audio file won't decode - what's wrong?
-
Missing feature flag:
- Ensure the codec/format is enabled in your
Cargo.toml - Use
features = ["all"]to enable everything
- Ensure the codec/format is enabled in your
-
Unsupported codec or format:
- Check Supported Codecs
- Check Supported Formats
- Look for codec/format status (”-” means not implemented)
-
Corrupted file:
- Test with
symphonia-play --probe yourfile.mp3 - Try the file in other players
- Test with
-
Incorrect hint:
- Let Symphonia probe without hint:
Hint::new() - Or provide correct extension
- Let Symphonia probe without hint:
-
File is not audio:
- Verify file type with
file yourfile.mp3
- Verify file type with
I'm getting audio glitches or artifacts
I'm getting audio glitches or artifacts
-
Codec status is “Good” or lower:
- Check status on Supported Codecs
- Some codecs are still in development
- Report issues on GitHub
-
Buffer underruns:
- Decoding too slow for real-time playback
- Use larger audio buffers
- Enable SIMD optimizations
- Profile and optimize
-
Incorrect sample rate conversion:
- Ensure audio output matches decoded sample rate
- Use proper resampling if needed
-
File encoding issues:
- Test with other decoders (FFmpeg)
- Try different files from the same source
Symphonia panics on certain files
Symphonia panics on certain files
-
Update to the latest version:
- Check if issue is already fixed
-
Report the issue:
- Open an issue on GitHub
- Include minimal reproducible example
- Share the problematic file if possible (or similar file)
-
Workaround:
- Use
catch_unwindto prevent process crash - Skip problematic files
- Use alternative decoder temporarily
- Use
How do I report bugs or request features?
How do I report bugs or request features?
-
Check existing issues:
- Search GitHub Issues
- Check GitHub Discussions
-
Provide details:
- Symphonia version
- Rust version
- Platform and architecture
- Minimal reproducible example
- Sample file (if relevant)
-
For bugs:
- Expected behavior
- Actual behavior
- Steps to reproduce
- Stack trace if applicable
-
For features:
- Use case description
- Why existing functionality doesn’t work
- Willingness to contribute
Contributing
How can I contribute to Symphonia?
How can I contribute to Symphonia?
-
Implement missing codecs or formats:
- Check the roadmap for ”-” status items
- Discuss your plans in an issue first
-
Fix bugs:
- Reproduce reported issues
- Submit fixes with tests
-
Optimize performance:
- Profile and identify bottlenecks
- Submit optimizations with benchmarks
-
Improve documentation:
- Add examples
- Clarify confusing sections
- Fix typos
-
Test your media library:
- Report issues with specific files
- Help validate decoders
-
Answer questions:
- Help other users in discussions
- Share your experience
What skills do I need to contribute decoders?
What skills do I need to contribute decoders?
- Strong Rust knowledge
- Understanding of DSP (Digital Signal Processing)
- Ability to read codec specifications
- Experience with bit-level data manipulation
- Debugging and testing skills
- Codec specifications (often available as RFCs or standards)
- Reference implementations (FFmpeg, etc.)
- Existing Symphonia decoders as examples
- DSP textbooks and online resources
- Start with simpler codecs (PCM, ADPCM)
- Reference existing implementations (with proper attribution)
- Write extensive tests
- Fuzz your implementation
- Ask for help in discussions
Still Have Questions?
If your question isn’t answered here:- Check the Getting Started Guide
- Read the API Documentation
- Browse GitHub Discussions
- Open a new GitHub Issue