dev: shush for now

This commit is contained in:
cha0s 2024-07-07 17:37:00 -05:00
parent f3fe70410f
commit 3875f897c2

View File

@ -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}>