mirror of
https://github.com/R0m1k3/podcastic.git
synced 2026-10-11 17:26:20 +02:00
fix: GainNode=0 pour activer le graphe Web Audio sans sortie son
This commit is contained in:
1 parent
45417c7d7f
commit
c04fa4e346
1 file changed
+4
-1
@@ -122,8 +122,11 @@ export function AudioProvider({ children }: { children: ReactNode }) {
|
||||
const analyser = ctx.createAnalyser();
|
||||
analyser.fftSize = 256;
|
||||
analyser.smoothingTimeConstant = 0.55;
|
||||
const sink = ctx.createGain();
|
||||
sink.gain.value = 0; // silent output — but graph stays active so analyser gets data
|
||||
source.connect(analyser);
|
||||
// Do NOT connect to destination — analysis element is silent via Web Audio too
|
||||
analyser.connect(sink);
|
||||
sink.connect(ctx.destination);
|
||||
webAudioRef.current = ctx;
|
||||
analyserRef.current = analyser;
|
||||
dataArrayRef.current = new Uint8Array(analyser.frequencyBinCount);
|
||||
|
||||
Reference in new issue
Block a user