0
votes

I am trying to create a React App on MeteorJS which uses the Web Audio API. It is a multi page app where each page uses web audio. I am declaring AudioContexts in all pages. I have reached the limit of 6 audio contexts allowed in an application. How do I declare one Audio Context for the whole app?

Uncaught DOMException: Failed to construct 'AudioContext': The number of hardware contexts provided (6) is greater than or equal to the maximum bound (6).

I have a routes file, where I can declare common objects maybe? How would I go about exporting the declared context? I tried exporting the AudioContext from another page to the latest page I am trying to make but it does not work. audioContext.close(); also does not work when I unmount components in other pages. Please Help. Thanks.

2

2 Answers

0
votes

just use one Audio Contect in the Master or Index Page => The Childs should be able to use the Context in the master... Or doesn't it work like that? Perhaps you have a coding example where we can try out the problem.

0
votes

So I found the answer I needed. It was a stupid mistake. I was not importing the audioContext as a method (ie within {} - for example:

import { audioContext } from './path';

) Thought it might be useful for people who have just started learning React.