GithubHelp home page GithubHelp logo

audio-engine's Introduction

Space Invaders Emulator

This is a emulator of the classic arcade game, Space Invaders (1978), write in Rust.

Controls

'Z' is Shoot, 'Left' and 'Right' arrows to move, 'Return' for 1 Player Start button, and 'Backspace' for the 2 Player Button.

And for binary builds with the debug feature enable, press Escape to enter the debug mode.

debugger

When in debug mode, you can enter commands in the terminal:

  • run to exit the debug mode;
  • bp <HEX ADRESS> to place a breakpoint at an address;
  • runto <HEX ADRESS> to run until the given address.

Compile

To compile and run to Windows, Linux or macOS, run the command cargo run --release.

Or cargo run --release --features=debug to enable the intel 8080 debugger.

WebAssembly

To compile to WebAssembly, you can use wasm-pack with the command:

wasm-pack build --target web --out-dir ../pkg  ./space-invaders-wasm

You can run it in a webpage by starting a http server in the root directory. You can use python for that, for example:

py -m http.server

audio-engine's People

Contributors

kyoobey avatar rodrigodd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kyoobey

audio-engine's Issues

Compiler error on WebAssembly

Is this engine capable to run under wasm32 ? Right now I get a compile error.

error[E0433]: failed to resolve: could not find `StreamInner` in `platform`
   --> /Users/markusmoenig/.cargo/registry/src/github.com-1ecc6299db9ec823/audio-engine-0.2.2/src/engine.rs:135:33
    |
135 |                 cpal::platform::StreamInner::WebAudio(x) => {
    |                                 ^^^^^^^^^^^ could not find `StreamInner` in `platform`

Send + Sync traits

Hi,

I am changing my app layout a bit and now require Send and Sync in my classes. Audio Engine fails with

Sender<audio_engine::engine::backend::StreamEvent> cannot be shared between threads safely
within ScreenEditor<'_>, the trait Sync is not implemented for Sender<audio_engine::engine::backend::StreamEvent>

I guess there are more traits which fail. Is it possible to add Send + Sync support ? Rhai for example has implemented this using a "Sync" feature.

Thanks

Crash on system with an external sound card

I have a beta user for eldiron.com who send me this screenshot of a crash inside the audio-engine. He said he has an external sound card, he is not a developer so unable to debug this further.

image_audio

Mixing of two audio sources

Hi,

congrats! You are the first library which works for me both on desktop and web.

The only things I would need is volume settings and mixing of two audio sources (background music and effects). Do you plan to support it ?

Thanks a lot!

`WavDecoder` don't support bit depth greater than 16

The WavDecoder uses hound to decode the WAV to i16 samples, but hound return a Result that errors when the target format is smaller than the bit depth of the file, or is in the wrong format (float vs int). audio-engine is currently unwrapping this Result and panicking.

audio-engine should not panic. Should at least decode the samples as i32 or f32 and convert them to i16 (and ideally support more sample formats).

Relevant source code:

audio-engine/src/wav.rs

Lines 36 to 48 in b256adb

#[allow(clippy::needless_range_loop)]
fn write_samples(&mut self, buffer: &mut [i16]) -> usize {
let mut samples = self.reader.samples::<i16>();
for i in 0..buffer.len() {
if let Some(sample) = samples.next() {
buffer[i] = sample.unwrap();
} else {
return i;
}
}
buffer.len()
}

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.