Nico-Mayer / p5-vue

Simply add p5 to your Vue and Nuxt projects ✌️
https://p5vue-homepage.vercel.app/
12 stars 0 forks source link

Sound not supported? #1

Open sniperadmin opened 1 year ago

sniperadmin commented 1 year ago

It looks like the sounds are not supported yet when trying to preload.

import p5 from 'p5'

const sketch = (p5: p5) => {
  p5.preload = () => {
    p5.loadSound('/some/path/string/values/file.mp3')
  }
}

The TS linter prints this:

TS2551: Property 'loadSound' does not exist on type 'import("C:/Users/Nasr/Desktop/socket-game/node_modules/@types/p5/index.d.ts")'. Did you mean 'loadJSON'?

The console prints this:

Uncaught TypeError: p52.loadSound is not a function
    at p52.preload (app.vue:34:26)
    at _._start (p5vue.js:10230:18)