#1528 Restores consistent audio segment start tone insertion, broken in #1506 (#1543)

Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
Denny Sheirer
2023-05-08 03:59:42 -04:00
committed by GitHub
parent 4f8b8e978b
commit 0af5963d08

View File

@@ -340,13 +340,6 @@ public abstract class AudioOutput implements LineListener, Listener<IdentifierUp
{
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;
@@ -392,6 +385,11 @@ public abstract class AudioOutput implements LineListener, Listener<IdentifierUp
while(mCurrentAudioSegment != null && mCurrentBufferIndex < mCurrentAudioSegment.getAudioBufferCount())
{
if(mCurrentBufferIndex == 0)
{
playAudio(mAudioSegmentStartTone);
}
try
{
float[] audioBuffer = mCurrentAudioSegment.getAudioBuffers().get(mCurrentBufferIndex++);