GithubHelp home page GithubHelp logo

dynwave's Introduction

dynwave

Build status dependency status license Crates.io dynwave docs.rs dynwave

dynwave is a dynamic audio player based on fixed samples stream, written in Rust.

The purpose of this is to implement a cross platform audio player that plays audio samples stream generated and plays it real-time.

This works as a fusion between rubato and cpal.

This is useful for emulators for example, where an emulation loop will be like this:

  1. Run emulation for a frame.
  2. Extract the collected audio samples for that frame.
  3. Queue the samples for playing (using dynwave).
  4. Take video frame and display it.
  5. Repeat.

Getting Started

You can use dynwave to play audio streams for your Rust projects.

Cargo

Add it as a dependency in your Cargo.toml file:

cargo add dynwave

Example usage

use dynwave::{AudioPlayer, BufferSize};

let mut player = AudioPlayer::<f32>::new(44100, BufferSize::OneSecond).unwrap();

// Start playing the audio
player.play().unwrap();

// generate audio samples (can be done in a emulation loop for example)
let samples = generate_samples();
player.queue(&samples);

// pause the audio
player.pause().unwrap();

Minimum Supported Rust Version (MSRV)

The minimum supported Rust version for this crate is 1.62.0.

Contributing

Contributions are welcome, please open an issue or a PR if you have any suggestions or ideas.

Make sure to:

  • Run cargo fmt.
  • Run cargo clippy.
  • Run cargo test.

Projects using dynwave

If you are using dynwave in your project, please open a PR to add it here.

Project Description
mizu A GameBoy emulator written in Rust (this is actually were this library originiated Amjad50/mizu#11)
trapezoid PSX emulator powered with Vulkan and Rust

License

This project is licensed under the MIT License - see the LICENSE file for details

dynwave's People

Contributors

amjad50 avatar

Stargazers

Tyler Weir avatar Mohamed Emad avatar Malek avatar Johan Lövgren avatar Clayton Kehoe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.