P25 - added parsing of packet payload data for confirmed PDUs.

This commit is contained in:
dennis.sheirer
2015-01-19 13:17:11 +00:00
parent 51d6b328bd
commit cc5edd4790
16 changed files with 872 additions and 82 deletions

View File

@@ -27,6 +27,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.UnsupportedAudioFileException;
@@ -127,10 +128,14 @@ public class ComplexWaveSource extends WaveSource
mBytesPerFrame = mInputStream.getFormat().getFrameSize();
if( mBytesPerFrame != 2 || mInputStream.getFormat().getChannels() != 2 )
AudioFormat format = mInputStream.getFormat();
if( format.getChannels() != 2 || format.getSampleSizeInBits() != 16 )
{
throw new IOException( "Unsupported Wave Format - requires two "
+ "channels with 16-bit samples" );
throw new IOException( "Unsupported Wave Format - EXPECTED: 2 " +
"channels 16-bit samples FOUND: " +
mInputStream.getFormat().getChannels() + " channels " +
mInputStream.getFormat().getSampleSizeInBits() + "-bit samples" );
}
mBuffer = new byte[ mBytesPerFrame * BUFFER_SAMPLE_SIZE ];