▲ | deadbabe 5 days ago | |||||||
Instead of exporting to a file is there a way to just make the sounds on the fly and then reuse them? For example in a JavaScript browser game? | ||||||||
▲ | fenomas 5 days ago | parent | next [-] | |||||||
I got way into webaudio and made some libraries to that effect. For something close to TFA, try wafxr: https://fenomas.github.io/wafxr/ It can export wav files, but its main purpose is to generate code snippets for playing the sound effect through webaudio, underneath using a much more general library. But people familiar with audio synthesis might prefer just using the underlying dependency directly - it basically turns arbitrary config into webaudio. This playground shows how it works: | ||||||||
▲ | jezzamon 5 days ago | parent | prev | next [-] | |||||||
SFXR is this is the canonical tool for doing that, and yes, you can do that! I'm not sure what this webpage is, jsxfr is the name of the JavaScript library on nodejs which is a different url to this page. But yeah once you start generating things procedurally you can do things like generate 10 sounds with subtle variations to make things less repetitive. | ||||||||
| ||||||||
▲ | whilenot-dev 5 days ago | parent | prev | next [-] | |||||||
Here's the docs for the API: https://github.com/chr15m/jsfxr?tab=readme-ov-file#api | ||||||||
▲ | chickenzzzzu 5 days ago | parent | prev [-] | |||||||
Dont know about the library but any byte array in javascript can be converted to base64 and referenced via a data url |