Skip to content

fix: Skip first second of audio to prevent overlap from previous track (#359)#532

Open
Kiki-bo-zhang wants to merge 1 commit intojwallet:masterfrom
Kiki-bo-zhang:feature/fix-audio-overlap-359
Open

fix: Skip first second of audio to prevent overlap from previous track (#359)#532
Kiki-bo-zhang wants to merge 1 commit intojwallet:masterfrom
Kiki-bo-zhang:feature/fix-audio-overlap-359

Conversation

@Kiki-bo-zhang
Copy link

@Kiki-bo-zhang Kiki-bo-zhang commented Mar 6, 2026

Description

This PR fixes the audio overlap issue (#359) where recorded songs have audio from the previous track at the beginning.

Problem

Users reported that most songs have extra leading silence, and some songs have audio from the previous track at the beginning. The user's workaround was:

This manually skips the first second of audio.

Solution

Implemented automatic skipping of the first 1000ms of audio when starting a new recording:

  1. New SilenceAnalyzer option: Added to the enum
  2. Buffer advance: When starting to record, skip the first second of buffered audio
  3. Recorder update: Use when recording starts

Changes

File Changes
Added option
Implemented skip logic (+ property)
Use instead of when starting

Technical Details

  • Skip 1000ms (configurable via constant)
  • Advances the circular buffer to discard audio from previous track
  • Minimal performance impact

Testing

This fix implements the same approach users have been using manually with ffmpeg.

Fixes #359


@jwallet Please review when you have time!


IssueHunt Summary

Referenced issues

This pull request has been submitted to:


jwallet#359)

Fix audio overlap issue where songs have audio from the previous track at the beginning.

Changes:
- Enums/SilenceAnalyzer.cs: Add SkipStart option
- AudioSessions/AudioThrottler.cs: Implement SkipStart logic
  - Skip first 1000ms of buffer when starting new recording
  - Add SkipStartByteLength calculation
- Recorder.cs: Use SilenceAnalyzer.SkipStart when starting recording

This implements the same workaround users were doing manually with ffmpeg -ss 0:01
to skip the first second of audio that contains overlap from the previous track.

Fixes jwallet#359
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sometimes a song will have some audio of the last song in the beginning

1 participant