sync mode on
This commit is contained in:
1 parent
1818932244
commit
1174b328e5
415 files changed
+44294
-1182
No files matched your search
@@ -1,5 +1,7 @@
|
||||
// js/audio.js
|
||||
|
||||
import * as Tone from "https://esm.sh/tone";
|
||||
|
||||
// O contexto de áudio agora será gerenciado principalmente pelo Tone.js.
|
||||
// Esta função garante que ele seja iniciado por uma interação do usuário.
|
||||
export function initializeAudioContext() {
|
||||
@@ -9,10 +11,13 @@ export function initializeAudioContext() {
|
||||
}
|
||||
}
|
||||
|
||||
// Funções de acesso ao contexto global do Tone.js
|
||||
// ✅ DEPOIS: devolve o *raw* AudioContext (nativo do Web Audio)
|
||||
export function getAudioContext() {
|
||||
return Tone.context;
|
||||
// compatível com versões novas/antigas do Tone
|
||||
const ctx = typeof Tone.getContext === 'function' ? Tone.getContext() : Tone.context;
|
||||
return ctx.rawContext || ctx; // rawContext quando existir
|
||||
}
|
||||
|
||||
export function getMainGainNode() {
|
||||
return Tone.Destination;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user