Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

AVBars Component's audio address, unable to use local audio files dynamically #129

Open
loneyao opened this issue Mar 13, 2023 · 1 comment

Comments

@loneyao
Copy link

loneyao commented Mar 13, 2023

       <AVBars
                              v-if='myAudio'
                              ref="player"
                              :src="myAudio"
                              caps-color="#FFF"
                              :bar-color="['#f00', '#ff0', '#0f0']"
                              canv-fill-color="#000"
                              :brick-height="6"
                              :bar-width="10"
                              :caps-height="2"
                          ></AVBars>

Here is my way to dynamically obtain audio files:

const uint8Buffer = Uint8Array.from(value);
const wav = new Blob([uint8Buffer]);
myAudio = window.URL.createObjectURL(wav);

image

@staskobzar
Copy link
Owner

If you are trying to load local file from the disk then there is something with the way you do it. I do not think it has anything to do with the plugin. It is designed to work with URLs.
Anything that works with <audio/> standard HTML element should work with the plugin.

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

No branches or pull requests

2 participants