Richienb / audic

Play some audio.
MIT License
68 stars 9 forks source link

Added callback feature. Resolves #8 #9

Closed ajithgopi closed 2 years ago

ajithgopi commented 3 years ago

Calls a callback function which will be called once the playback is not completed.

Usage:

const player = new Audic("audio.wav", function(){
    console.log("Completed")
})

NB: I have originally made the changes in my JavaScript files and only copied it to .ts file becuase I'm not familiar with typescript yet. It would be great if you could tell me how to generate the JS files from TS file 'cause I find that the JS files are not direct conversion of the TS files.

ajithgopi commented 3 years ago

Theoretically, Trigger status will be reset when play() is called. Im not able to rltest without knowing how to generate the js..

Richienb commented 3 years ago

Im not able to rltest without knowing how to generate the js..

To generate the js in a local clone, install the dependencies with npm install then run npm run build to build the JavaScript. Then you can import it from the Node.js REPL to check it out.