-
Notifications
You must be signed in to change notification settings - Fork 0
"AudioContext was not allowed to start..." #2
Comments
Hi @F0h, can you send me the console logs, I think this must be because you attempt to start making sounds without any user interaction. There's no way around it, you have to add a button or something. If it is what I think it is. |
Hi hlolli, Thanks for your answer. |
Yes, everything is a promise, all you have to do it to resolve them.
Async/await or csound.startRealtime().then(() => {...here can be empty or
some action you want to take place after realtime has started.... })
…On Mon, 13 Jan 2020 at 20:28, F0h ***@***.***> wrote:
Hi hlolli, Thanks for your answer.
I use csound quite well but I am new to web technology.
Console return this warnings:
"The AudioContext was not allowed to start. It must be resumed (or
created) after a user gesture on the page. https://goo.gl/7K7WLu"
Yes I know user must trigger an event...
I would like to know what a button should trigger?
csound.startRealtime ()?
Is it necessary to write a promise?
Regards.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2?email_source=notifications&email_token=ABOLDAWBBN6KDVPPHJWSYODQ5S6GDA5CNFSM4KF734ZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIZ7FVQ#issuecomment-573829846>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABOLDAUCOQ7UBSCJQU5REZ3Q5S6GDANCNFSM4KF734ZA>
.
|
yes you're right, lol. So it's like you initially pointed out, just call
that function.
What I should probably document better, is that you should call csound.
startRealtime(); from user activity. Because just by
including csound-wasm-browser.js in your website, it will automatically
start loading csound. startRealtime() will just be queued until ready to
start. And startRealtime only needs to be called once, for the rest of the
browser session, you don't need specific things from the user to send
events to csound.
Can you send me a minimal example of your failing code? Did you try the
example in the readme?
…On Tue, 14 Jan 2020 at 20:41, F0h ***@***.***> wrote:
mmm, but csound.startRealtime() has not a then function.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2?email_source=notifications&email_token=ABOLDAQP7KD5EXWOILLXEC3Q5YIODA5CNFSM4KF734ZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI53QXI#issuecomment-574339165>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABOLDAWYTFU5VLWABFMHTQLQ5YIODANCNFSM4KF734ZA>
.
|
Oh ... I deleted my post because I was trying to find out how to add a Promise to startRealtime () ... |
//This is my HelloCsound... ;instrument will be triggered by keyboard widget ;;;;;;;;;;;;;;;;;;;;;;;;; /////////// hlolli library //////////////// const updateCsound = () => {
} |
When you run index.html from local, are you refering to http://localhost:port or file:///home/index.html... ? |
Yes. When I open file:///home/index.html.. |
You may want to use something like https://www.npmjs.com/package/http-server when you are working on javascript locally. I think this is because of strict security around AudioWorklets that makes file:// protocol unavailable. |
But I'll keep you postet, I'll be making an overhaul on this project in next weeks. Maybe I can find a way or hack to make it work with file:// too. |
thanks anyway. |
Hello hlolli. |
Hi Hlöðver.
Thank you for your project, I use Csound quite well but I'm new to web technology and would like to ask you if there is any way to resolve the warning "AudioContext was not allowed to start..."
The synthesizer that I'm implementing works very well in Brave, but not in Opera 66 or Chrome 79.
When I use it from a server it works.
I'm using Visual Studio Code and LiveServer
Regards!
The text was updated successfully, but these errors were encountered: