chore: remove debug console.log calls from audio TS interop
This commit is contained in:
@@ -100,7 +100,6 @@ export class AudioPlayer {
|
||||
// Initialize new stream
|
||||
this.isStreamingMode = true;
|
||||
this.streamDecoder.initialize(totalStreamLength);
|
||||
console.log(`Streaming initialized: ${totalStreamLength} bytes expected`);
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
return { success: false, error: (error as Error).message };
|
||||
@@ -126,7 +125,6 @@ export class AudioPlayer {
|
||||
}
|
||||
}
|
||||
this.streamingCompleted = true;
|
||||
console.log('Stream marked complete by C# signal');
|
||||
return { success: true, bufferCount: this.scheduler.getBufferCount() };
|
||||
} catch (error) {
|
||||
return { success: false, error: (error as Error).message };
|
||||
@@ -157,7 +155,6 @@ export class AudioPlayer {
|
||||
// Check if streaming is complete
|
||||
if (this.streamDecoder.isComplete) {
|
||||
this.streamingCompleted = true;
|
||||
console.log('Stream complete');
|
||||
}
|
||||
|
||||
const canStart = this.streamDecoder.headerParsed &&
|
||||
@@ -181,8 +178,6 @@ export class AudioPlayer {
|
||||
}
|
||||
|
||||
try {
|
||||
console.log('\n=== Starting streaming playback ===');
|
||||
|
||||
// A backgrounded tab leaves AudioContext suspended. createBufferSource/start
|
||||
// against a suspended context produces no audio without throwing — the same
|
||||
// failure mode that was fixed for play() (resume path). Awaiting ensureReady()
|
||||
@@ -198,7 +193,6 @@ export class AudioPlayer {
|
||||
this.scheduler.playFromPosition(0);
|
||||
this.startProgressTracking();
|
||||
|
||||
console.log('✅ Streaming playback started');
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
return { success: false, error: (error as Error).message };
|
||||
@@ -218,7 +212,6 @@ export class AudioPlayer {
|
||||
|
||||
// Don't restart if already playing
|
||||
if (this.isPlaying) {
|
||||
console.log('Already playing, ignoring play()');
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
@@ -236,7 +229,6 @@ export class AudioPlayer {
|
||||
this.scheduler.playFromPosition(this.pausePosition);
|
||||
this.startProgressTracking();
|
||||
|
||||
console.log(`▶️ Resumed from ${this.pausePosition.toFixed(3)}s`);
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
return { success: false, error: (error as Error).message };
|
||||
@@ -254,7 +246,6 @@ export class AudioPlayer {
|
||||
this.isPaused = true;
|
||||
this.stopProgressTracking();
|
||||
|
||||
console.log(`⏸️ Paused at ${this.pausePosition.toFixed(3)}s`);
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
return { success: false, error: (error as Error).message };
|
||||
@@ -268,7 +259,6 @@ export class AudioPlayer {
|
||||
this.resetState();
|
||||
this.stopProgressTracking();
|
||||
|
||||
console.log('⏹️ Stopped');
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
return { success: false, error: (error as Error).message };
|
||||
@@ -312,7 +302,6 @@ export class AudioPlayer {
|
||||
this.scheduler.playFromPosition(Math.max(0, bufferRelativePosition));
|
||||
}
|
||||
|
||||
console.log(`🔍 Seeked within buffer to ${position.toFixed(3)}s (buffer-relative: ${bufferRelativePosition.toFixed(3)}s)`);
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
return { success: false, error: (error as Error).message };
|
||||
@@ -331,8 +320,6 @@ export class AudioPlayer {
|
||||
return { success: false, error: 'Cannot calculate byte offset' };
|
||||
}
|
||||
|
||||
console.log(`🔍 Seek beyond buffer to ${position.toFixed(3)}s requires byte offset ${byteOffset}`);
|
||||
|
||||
// Signal that C# needs to request new stream from offset
|
||||
return {
|
||||
success: true,
|
||||
@@ -364,9 +351,6 @@ export class AudioPlayer {
|
||||
*/
|
||||
reinitializeFromOffset(totalStreamLength: number, seekPosition: number): AudioResult {
|
||||
try {
|
||||
console.log(`\n=== Reinitializing for offset stream ===`);
|
||||
console.log(`Seek position: ${seekPosition.toFixed(3)}s, Stream length: ${totalStreamLength}`);
|
||||
|
||||
// Stop current playback
|
||||
this.stopProgressTracking();
|
||||
const wasPlaying = this.isPlaying;
|
||||
@@ -384,7 +368,6 @@ export class AudioPlayer {
|
||||
this.streamingStarted = false; // Will restart when new buffers arrive
|
||||
this.streamingCompleted = false;
|
||||
|
||||
console.log(`✅ Reinitialized for offset, was playing: ${wasPlaying}`);
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
return { success: false, error: (error as Error).message };
|
||||
|
||||
Reference in New Issue
Block a user