Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
phonic is a cross-platform audio playback and DSP library for Rust, providing a flexible, low-latency audio engine and related tools for games and music applications.
Originally developed for the AFEC-Explorer app, phonic initially addressed the need for precise playback position monitoring not found in other Rust audio libraries. It is now also used as the default sample playback engine for the experimental algorithmic sequencer pattrns.
[!NOTE] phonic has not yet reached a stable version, so expect breaking changes. The effects API in particular is a work in progress and will likely change in the future.
Features
-
Cross-Platform Audio Playback:
- Play audio on Windows, macOS, and Linux via cpal.
- WebAssembly support for in-browser audio using sokol and emscripten.
- Optional WAV file output device for rendering computed audio to a file instead of playing it back.
-
Flexible Audio Source Handling:
-
Advanced Playback Control:
- Sample-precise scheduling for accurate sequencing.
- Real-time monitoring of playback position and status for GUI integration.
- Dynamic control over volume, panning, and playback speed.
-
Custom Synthesis and DSPs:
- Build simple or complex DSP graphs by routing audio through optional sub-mixers.
- Play completely custom-built synthesizers or use the optional dasp integration for creating synth sources.
- Apply custom-built DSP effects or use built-in effects (reverb, chorus, filter, compressor).
Documentation
Rust docs for the last published versions are available at https://docs.rs/phonic
Examples
See /examples directory for more examples.
File Playback with Monitoring
Play, seek and stop audio files on the default audio output device. Monitor playback status of playing files.
use ;
File playback with DSP Effects in a Mixer Graph
Create complex audio processing chains by routing sources through different mixers and effects.
use ;
Contributing
Patches are welcome! Please fork the latest git repository and create a feature or bugfix branch.
License
phonic is distributed under the terms of the GNU Affero General Public License V3.