renderizando projetos no mmpCreator sem erros
This commit is contained in:
1 parent
faaf8752a8
commit
e902e8d735
3 files changed
+75
-122
No files matched your search
@@ -68,10 +68,7 @@ function _convertSecondsToBeat(seconds) {
|
||||
function _initContext() {
|
||||
if (!audioCtx) {
|
||||
initializeAudioContext();
|
||||
// ✅ garante que é o AudioContext nativo
|
||||
audioCtx = Tone.getContext().rawContext;
|
||||
} else if (audioCtx.rawContext) {
|
||||
audioCtx = audioCtx.rawContext;
|
||||
audioCtx = getAudioContext(); // deve ser o rawContext do Tone
|
||||
}
|
||||
}
|
||||
|
||||
@@ -407,17 +404,16 @@ export async function startAudioEditorPlayback(seekTime) {
|
||||
|
||||
// garante contexto ativo do Tone (gesto do usuário já ocorreu antes)
|
||||
await Tone.start();
|
||||
|
||||
const raw = audioCtx?.rawContext || audioCtx;
|
||||
if (raw?.state === "suspended" && typeof raw.resume === "function") {
|
||||
await raw.resume();
|
||||
if (audioCtx.state === "suspended") {
|
||||
await audioCtx.resume();
|
||||
}
|
||||
audioCtx = raw;
|
||||
// alinhamento de relógio próprio
|
||||
startTime = audioCtx.currentTime;
|
||||
|
||||
isPlaying = true;
|
||||
appState.global.isAudioEditorPlaying = true;
|
||||
|
||||
// alinhamento de relógio próprio (mantido para o seu scheduler)
|
||||
startTime = audioCtx.currentTime;
|
||||
|
||||
// 1. Determine o tempo de início:
|
||||
let timeToStart =
|
||||
seekTime !== null && seekTime !== undefined && !isNaN(seekTime)
|
||||
|
||||
Reference in new issue
Block a user