Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Importing webaudio controls using import - need to wrap in vue #81

Open
abulka opened this issue Jan 21, 2022 · 1 comment
Open

Importing webaudio controls using import - need to wrap in vue #81

abulka opened this issue Jan 21, 2022 · 1 comment

Comments

@abulka
Copy link

abulka commented Jan 21, 2022

@micbuffa This project looks intriguing to me as it seems to use modern ES module imports with the webaudio controls - could that be considered one of the purposes of this project? The webaudio official docs don't mention import usage.

I'm trying to wrap some webaudio controls in a vue component, so that it plays nice in vue. Should I perhaps be using this project instead of the original g200kg version?

P.S. Not sure if you know anything about vue, but whilst I was able to import the g200kg javascript file in a .vue file using

<template>
  <webaudio-knob ref="knobRef" src="../knobs/LittlePhatty.png" min="0" max="100"></webaudio-knob>
</template>

<script>
import "https://g200kg.github.io/webaudio-controls/webaudio-controls.js"
...

but this gave me

Failed to resolve component: webaudio-knob

Not sure switching to your project would actually help?

@micbuffa
Copy link
Member

Hi, here you can find a very simple vueJS project with webaudiocontrols imported in the HelloWorld.vue component. The trick is to understand that in <webaudio-knob src="./LittlePhatty.png", . corresponds to the public folder. The VueJS compiler resolves . in <img src="./image.png" so you can have image.png under the src folder, but this does not work with custom elements from the webaudiocontrols lib. See this github project : https://github.com/micbuffa/vueJSWithWebAudioControls.git

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants