Comments (7)
I'm experiencing the same issue, but when I launch piano-rs
(the cargo installed version) when the current directory contains the assets
folder, it works fine.
Tested this for the cloned git repo, and also when i copied the assets
folder into another directory. Both cases work, but once assets
folder is not visible in the currency directory, piano-rs
just exits as soon as i press a key.
from piano-rs.
I think include_bytes! macro might work?
I didn't look into your asset loading code though, so I might wrong.
from piano-rs.
I see. However, since the sound files are not ours and have been taken from http://multiplayerpiano.com, I think we should avoid going as far as to ship the sound files with the binary itself. That way, if mutliplayerpiano guys decide they no longer want us to use their sound files, one can simply overwrite the files in the assets directory with other sound files and keep going without breaking existing binaries. If that makes sense.
Another benefit of loading assets dynamically is that people can experiment with their own sound files if they wish to without having to re-compile.
from piano-rs.
This tool uses the rodio crate to play sounds which in turn depends on cpal crate. If there is no sound, it is probably cpal at fault. Do you hear any sound on running cpal's beep.rs example? If not, you'll get better help opening an issue there.
from piano-rs.
Yep, I recommend to install piano-rs using git clone. I released on cargo just for testing purpose, I am still not sure what is the best way to link external assets with cargo..
from piano-rs.
Just to confirm what @darrenldl said. I ran into exact same issue and running in a dir containing asset
worked.
from piano-rs.
Same thing here. @darrenldl is right, you load the samples dynamically and you could just include them using include_bytes!
. This way your samples will be hard-coded during compilation (and therefore shipped with the binary).
from piano-rs.
Related Issues (20)
- Display alphabet on the keys
- Support more key combos HOT 1
- Add ability to record and replay sounds HOT 1
- Play from file and keyboard simultaneously HOT 1
- Adjust piano volume internally
- Modify playback speed when playing from file HOT 1
- Strange keybinding, it should start from C rather than E. HOT 10
- [Debian based] error: failed to run custom build command for `alsa-sys v0.1.1` HOT 8
- Support playback from MIDI format
- error: failed to run custom build command for `termbox-sys v0.2.10 HOT 11
- Make Rust 2018 Edition changes HOT 1
- [Arch based] error: failed to run custom build command for `alsa-sys` HOT 1
- panicked at 'called Result::unwrap() on an Err HOT 19
- Spontaneous demo video HOT 2
- Compilation failed: Fix by installing pkg-config
- fix bahaviour on long press HOT 2
- allow custom key bindings via a config file
- Multiplayer support? HOT 1
- Windows support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from piano-rs.