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

how to make sound from a file , #161

Open
divineuniverse opened this issue Jan 15, 2022 · 1 comment
Open

how to make sound from a file , #161

divineuniverse opened this issue Jan 15, 2022 · 1 comment

Comments

@divineuniverse
Copy link

divineuniverse commented Jan 15, 2022

Hi ,

i am new to prizzicato.js , and now i am learning about it ,
but i found that i cannot load up any sound from a file ,
( i am using laptop with chrome browser ) ,

var tSnd = new Pizzicato.Sound( './audio/sound.wav' );
tSnd.play();

may i know do i need to do sth in the setting or config or others ,
really many thanks for this help and reply ,

thanks ALL , : )

=== === ===

BTW , i hv also tried to pass an AudioObject into it , such as ,
var XX = new Audio();' XX.src = './audio/sound.wav'; XX.load();`

var tSnd = new Pizzicato.Sound( XX );
tSnd.play();
or
var tSnd = new Pizzicato.Sound( XX.src );
tSnd.play();

but these also NOT work ,

@pascalwengerter
Copy link

@divineuniverse I've stumbled upon the same issue today. The key is serving your files over HTTP (e.g. by running a super simple Go server like https://gist.github.com/paulmach/7271283), because the relative links from your HTML/JS resolve to using file:// URLs that then cause CORS issues

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