Skip to content

Commit

Permalink
#1528 Restores consistent audio segment start tone insertion, broken in
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Sheirer committed May 8, 2023
1 parent 4f8b8e9 commit d5e109e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main/java/io/github/dsheirer/audio/playback/AudioOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,6 @@ private void loadNextAudioSegment()
{
mCurrentAudioSegment.addIdentifierUpdateNotificationListener(this);
broadcast(mCurrentAudioSegment.getIdentifierCollection());

//If we played any amount of the previous audio segment then play the audio segment start. We check this
//to avoid repeatedly playing an audio segment start tone on the rare occasion that we have empty segments.
if(mCurrentBufferIndex > 0)
{
playAudio(mAudioSegmentStartTone);
}
}

mCurrentBufferIndex = 0;
Expand Down Expand Up @@ -392,6 +385,11 @@ private void processAudio()

while(mCurrentAudioSegment != null && mCurrentBufferIndex < mCurrentAudioSegment.getAudioBufferCount())
{
if(mCurrentBufferIndex == 0)
{
playAudio(mAudioSegmentStartTone);
}

try
{
float[] audioBuffer = mCurrentAudioSegment.getAudioBuffers().get(mCurrentBufferIndex++);
Expand Down

0 comments on commit d5e109e

Please sign in to comment.