dev: shush for now
This commit is contained in:
parent
f3fe70410f
commit
3875f897c2
|
@ -92,29 +92,29 @@ export default function PlaySpecific() {
|
|||
clearInterval(handle);
|
||||
};
|
||||
}, [client, disconnected, setMainEntity, url]);
|
||||
useEffect(() => {
|
||||
let source = true;
|
||||
async function play() {
|
||||
const ctx = new AudioContext();
|
||||
const response = await fetch(new URL('/assets/yuff.wav', window.location.origin));
|
||||
const buffer = await ctx.decodeAudioData(await response.arrayBuffer());
|
||||
if (!source) {
|
||||
return;
|
||||
}
|
||||
source = ctx.createBufferSource();
|
||||
source.buffer = buffer;
|
||||
source.connect(ctx.destination);
|
||||
source.loop = true;
|
||||
source.start();
|
||||
}
|
||||
setTimeout(play, 1000);
|
||||
return () => {
|
||||
if (true !== source) {
|
||||
source.stop();
|
||||
}
|
||||
source = false;
|
||||
};
|
||||
}, [])
|
||||
// useEffect(() => {
|
||||
// let source = true;
|
||||
// async function play() {
|
||||
// const ctx = new AudioContext();
|
||||
// const response = await fetch(new URL('/assets/yuff.wav', window.location.origin));
|
||||
// const buffer = await ctx.decodeAudioData(await response.arrayBuffer());
|
||||
// if (!source) {
|
||||
// return;
|
||||
// }
|
||||
// source = ctx.createBufferSource();
|
||||
// source.buffer = buffer;
|
||||
// source.connect(ctx.destination);
|
||||
// source.loop = true;
|
||||
// source.start();
|
||||
// }
|
||||
// setTimeout(play, 1000);
|
||||
// return () => {
|
||||
// if (true !== source) {
|
||||
// source.stop();
|
||||
// }
|
||||
// source = false;
|
||||
// };
|
||||
// }, [])
|
||||
return (
|
||||
<ClientContext.Provider value={client}>
|
||||
<MainEntityContext.Provider value={mainEntityTuple}>
|
||||
|
|
Loading…
Reference in New Issue
Block a user