fix: set subTab buffer + fix double stop() call + realtime playhead

This commit is contained in:
2026-07-25 19:48:00 +07:00
parent 7f681f23c1
commit f3ad111376
2 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -9862,7 +9862,10 @@ const App = () => {
recordingStartTimeRef.current = startTime;
setRecordingState('RECORDING');
setRecTempMidiNotes([]);
startSubTabPlayback(tab, startTime);
const ctx = getAudioContext();
const silentBuf = ctx.createBuffer(1, 128, ctx.sampleRate);
setSubTabs(prev => prev.map(s => s.id === tab.id ? { ...s, buffer: silentBuf } : s));
startSubTabPlayback({ ...tab, buffer: silentBuf }, startTime);
startOffsetTimeRef.current = startTime;
startAudioTimeRef.current = context.currentTime;
setIsPlaying(true);
@@ -10081,7 +10084,6 @@ const App = () => {
for (let trackId in midiRecorders) {
const midiRec = midiRecorders[trackId];
const recordedNotes = midiRec.stop();
if (midiRec.tempTabId) {
const recordedNotes = midiRec.stop();