mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Co-authored-by: Denny <denny@denny-desktop>
This commit is contained in:
@@ -49,11 +49,14 @@ public abstract class AbstractAudioModule extends Module implements IAudioSegmen
|
||||
|
||||
/**
|
||||
* Constructs an abstract audio module
|
||||
*
|
||||
* @param aliasList for aliasing identifiers
|
||||
* @param maxSegmentAudioSampleLength in milliseconds
|
||||
*/
|
||||
public AbstractAudioModule(AliasList aliasList, int maxSegmentAudioSampleLength)
|
||||
public AbstractAudioModule(AliasList aliasList, long maxSegmentAudioSampleLength)
|
||||
{
|
||||
mAliasList = aliasList;
|
||||
mMaxSegmentAudioSampleLength = maxSegmentAudioSampleLength;
|
||||
mMaxSegmentAudioSampleLength = (int)(maxSegmentAudioSampleLength * 8); //Convert milliseconds to samples
|
||||
mIdentifierUpdateNotificationBroadcaster.addListener(mIdentifierCollection);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,10 +79,13 @@ public class AudioModule extends AbstractAudioModule implements ISquelchStateLis
|
||||
|
||||
/**
|
||||
* Creates an Audio Module.
|
||||
*
|
||||
* @param aliasList for aliasing identifiers
|
||||
* @param maxAudioSegmentLength in milliseconds
|
||||
*/
|
||||
public AudioModule(AliasList aliasList, int maxSegmentAudioSampleLength)
|
||||
public AudioModule(AliasList aliasList, long maxAudioSegmentLength)
|
||||
{
|
||||
super(aliasList, maxSegmentAudioSampleLength);
|
||||
super(aliasList, maxAudioSegmentLength);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,17 +127,17 @@ public class AudioModule extends AbstractAudioModule implements ISquelchStateLis
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receive(ReusableFloatBuffer reusableFloatBuffer)
|
||||
public void receive(ReusableFloatBuffer audioBuffer)
|
||||
{
|
||||
if(mSquelchState == SquelchState.UNSQUELCH)
|
||||
{
|
||||
ReusableFloatBuffer buffer = mHighPassFilter.filter(reusableFloatBuffer);
|
||||
addAudio(buffer.getSamples());
|
||||
buffer.decrementUserCount();
|
||||
ReusableFloatBuffer highPassFilteredAudio = mHighPassFilter.filter(audioBuffer);
|
||||
addAudio(highPassFilteredAudio.getSamplesCopy());
|
||||
highPassFilteredAudio.decrementUserCount();
|
||||
}
|
||||
else
|
||||
{
|
||||
reusableFloatBuffer.decrementUserCount();
|
||||
audioBuffer.decrementUserCount();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user