Giter Club home page Giter Club logo

Comments (7)

darrenldl avatar darrenldl commented on August 22, 2024 2

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.

darrenldl avatar darrenldl commented on August 22, 2024 1

I think include_bytes! macro might work?

I didn't look into your asset loading code though, so I might wrong.

from piano-rs.

ritiek avatar ritiek commented on August 22, 2024 1

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.

ritiek avatar ritiek commented on August 22, 2024

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.

ritiek avatar ritiek commented on August 22, 2024

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.

jsomedon avatar jsomedon commented on August 22, 2024

Just to confirm what @darrenldl said. I ran into exact same issue and running in a dir containing asset worked.

from piano-rs.

micouy avatar micouy commented on August 22, 2024

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)

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.