diff --git a/src/main/java/io/github/dsheirer/audio/playback/AudioOutput.java b/src/main/java/io/github/dsheirer/audio/playback/AudioOutput.java index 0930863c..34ce747c 100644 --- a/src/main/java/io/github/dsheirer/audio/playback/AudioOutput.java +++ b/src/main/java/io/github/dsheirer/audio/playback/AudioOutput.java @@ -79,6 +79,7 @@ public abstract class AudioOutput implements LineListener, Listener mProcessorFuture; + private boolean mDropDuplicates; private long mOutputLastTimestamp = 0; private static final long STALE_PLAYBACK_THRESHOLD_MS = 500; @@ -104,6 +105,7 @@ public abstract class AudioOutput implements LineListener, Listener 0) { @@ -385,29 +389,42 @@ public abstract class AudioOutput implements LineListener, Listener 0) { - ByteBuffer audio = convert(audioBuffer); - //This call blocks until all audio bytes are dumped into the data line. - playAudio(audio); + playAudio(mAudioSegmentDropTone); } + + disposeCurrentAudioSegment(); } - catch(Exception e) + else { - mLog.error("Error while processing audio for [" + mMixerChannel.name() + "]", e); + if(mCurrentBufferIndex == 0) + { + playAudio(mAudioSegmentStartTone); + } + + try + { + float[] audioBuffer = mCurrentAudioSegment.getAudioBuffers().get(mCurrentBufferIndex++); + + if(audioBuffer != null) + { + ByteBuffer audio = convert(audioBuffer); + //This call blocks until all audio bytes are dumped into the data line. + playAudio(audio); + } + } + catch(Exception e) + { + mLog.error("Error while processing audio for [" + mMixerChannel.name() + "]", e); + } } } - //Check for completed and fully-played audio segment -- load next audio segment + //Check for completed and fully-played audio segment to closeout if(mCurrentAudioSegment != null && mCurrentAudioSegment.isComplete() && (mCurrentBufferIndex >= mCurrentAudioSegment.getAudioBufferCount())) @@ -649,16 +666,6 @@ public abstract class AudioOutput implements LineListener, Listener private List createTalkgroupDetails() { List details = new ArrayList<>(); + details.add(new TalkgroupDetail(Protocol.AM, IntegerFormat.DECIMAL, new IntegerFormatter(0,65535), + new IntegerFormatter(0,65535), "Format 0 - 65535")); + details.add(new TalkgroupDetail(Protocol.AM, IntegerFormat.HEXADECIMAL, new IntegerFormatter(0,65535), + new IntegerFormatter(0,65535), "Format 0 - FFFF")); details.add(new TalkgroupDetail(Protocol.APCO25, IntegerFormat.DECIMAL, new IntegerFormatter(0,65535), new IntegerFormatter(0,65535), "Format: 0 - 65535")); details.add(new TalkgroupDetail(Protocol.APCO25, IntegerFormat.HEXADECIMAL, new HexFormatter(0,65535), @@ -307,6 +310,10 @@ public class TalkgroupRangeEditor extends IdentifierEditor details.add(new TalkgroupDetail(Protocol.MPT1327, IntegerFormat.FORMATTED, new PrefixIdentFormatter(0,0xFFFFF), new PrefixIdentFormatter(0,0xFFFFF), "Format: PPP-IIII = Prefix (0-127), Ident (1-8191)")); + details.add(new TalkgroupDetail(Protocol.NBFM, IntegerFormat.DECIMAL, new IntegerFormatter(0,65535), + new IntegerFormatter(0,65535), "Format 0 - 65535")); + details.add(new TalkgroupDetail(Protocol.NBFM, IntegerFormat.HEXADECIMAL, new IntegerFormatter(0,65535), + new IntegerFormatter(0,65535), "Format 0 - FFFF")); details.add(new TalkgroupDetail(Protocol.PASSPORT, IntegerFormat.DECIMAL, new IntegerFormatter(0,0xFFFF), new IntegerFormatter(0,0xFFFF), "Format: 0 - 65535")); details.add(new TalkgroupDetail(Protocol.PASSPORT, IntegerFormat.HEXADECIMAL, new HexFormatter(0,0xFFFF),