Class PcmVolumeProcessor


  • public class PcmVolumeProcessor
    extends java.lang.Object
    Class used to apply a volume level to short PCM buffers
    • Constructor Summary

      Constructors 
      Constructor Description
      PcmVolumeProcessor​(int initialVolume)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void applyVolume​(int initialVolume, int targetVolume, java.nio.ShortBuffer buffer)  
      int getLastVolume()  
      void setLastVolume​(int lastVolume)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PcmVolumeProcessor

        public PcmVolumeProcessor​(int initialVolume)
        Parameters:
        initialVolume - Initial volume level (only useful for getLastVolume() as specified with each call)
    • Method Detail

      • getLastVolume

        public int getLastVolume()
        Returns:
        Last volume level used with this processor
      • setLastVolume

        public void setLastVolume​(int lastVolume)
        Parameters:
        lastVolume - Value to explicitly set for the return value of getLastVolume()
      • applyVolume

        public void applyVolume​(int initialVolume,
                                int targetVolume,
                                java.nio.ShortBuffer buffer)
        Parameters:
        initialVolume - The input volume of the samples
        targetVolume - The target volume of the samples
        buffer - The buffer containing the samples