christopherspeed / christopherspeed.github.io

MIT License
1 stars 0 forks source link

Determine how to add static files (images, music) to the project #4

Open parkerc22 opened 1 year ago

parkerc22 commented 1 year ago

const guitarMusic = require("./public/music.mp3").default;

If we have a directory called "public" with the desired file inside (music or an image or the like), the above code generates a local URL that we can use in app.js:

audioLoader.load( guitarMusic, function( buffer ) { ... });