mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 00:57:31 -05:00
P25 audio decoder integration.
Auto-discovers the jmbe ( https://github.com/DSheirer/jmbe ) library at startup and provides decode P25 Phase 1 audio
This commit is contained in:
@@ -30,12 +30,11 @@ import org.slf4j.LoggerFactory;
|
||||
import sample.real.RealSampleListener;
|
||||
import buffer.FloatSampleBufferAssembler;
|
||||
|
||||
public class AudioOutput implements RealSampleListener,
|
||||
SquelchListener,
|
||||
AudioTypeListener
|
||||
public class AudioOutputImpl implements RealSampleListener,
|
||||
SquelchListener, IAudioTypeListener, IAudioOutput
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( AudioOutput.class );
|
||||
LoggerFactory.getLogger( AudioOutputImpl.class );
|
||||
private static final int sAUDIO_BLOCK_SIZE = 24000;
|
||||
|
||||
private static final AudioFormat sAUDIO_FORMAT =
|
||||
@@ -54,7 +53,7 @@ public class AudioOutput implements RealSampleListener,
|
||||
private boolean mEnabled = false;
|
||||
private SquelchState mSquelchState = SquelchState.SQUELCH;
|
||||
|
||||
public AudioOutput( String channelName )
|
||||
public AudioOutputImpl( String channelName )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -75,11 +74,13 @@ public class AudioOutput implements RealSampleListener,
|
||||
mSquelchState = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAudioPlaybackEnabled( boolean enabled )
|
||||
{
|
||||
mEnabled = enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose()
|
||||
{
|
||||
mOutput.stop();
|
||||
28
src/audio/IAudioOutput.java
Normal file
28
src/audio/IAudioOutput.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package audio;
|
||||
|
||||
import audio.SquelchListener.SquelchState;
|
||||
|
||||
public interface IAudioOutput
|
||||
{
|
||||
/**
|
||||
* Squelch / Unsquelch state for this channel
|
||||
*/
|
||||
public abstract void setSquelch( SquelchState state );
|
||||
|
||||
/**
|
||||
* Audio playback defines if this channel is currently playing on the
|
||||
* system speakers.
|
||||
*/
|
||||
public abstract void setAudioPlaybackEnabled( boolean enabled );
|
||||
|
||||
/**
|
||||
* Dispose of any system resources for this audio output
|
||||
*/
|
||||
public abstract void dispose();
|
||||
|
||||
/**
|
||||
* Sets the audio to normal or inverted output
|
||||
*/
|
||||
public abstract void setAudioType( AudioType type );
|
||||
|
||||
}
|
||||
@@ -17,7 +17,7 @@
|
||||
******************************************************************************/
|
||||
package audio;
|
||||
|
||||
public interface AudioTypeListener
|
||||
public interface IAudioTypeListener
|
||||
{
|
||||
public void setAudioType( AudioType type );
|
||||
}
|
||||
Reference in New Issue
Block a user