#2301 am decoder enhancements. New squelch control and filter enhancements. (#2556)

Co-authored-by: denny <dennis.sheirer@gmail.com>
This commit is contained in:
Denny Sheirer
2026-11-01 08:55:34 -05:00
committed by GitHub
parent 19d18b96b3
commit 8aadbe4706
33 changed files with 1886 additions and 396 deletions

View File

@@ -30,6 +30,16 @@ import javax.sound.sampled.AudioFormat;
*/
public abstract class AudioProvider
{
/**
* Converts the audio sample to a 16-bit PCM sample, limiting out of range values instead of allowing them to wrap.
* @param sample in range -1.0 to 1.0
* @return PCM sample
*/
protected static short toPcm(float sample)
{
return (short)(Math.clamp(sample, -1.0f, 1.0f) * Short.MAX_VALUE);
}
/**
* Audio format for this provider
*/