Package sidplay.audio

Klasse AudioConfig

java.lang.Object
sidplay.audio.AudioConfig

public class AudioConfig extends Object
Audio configuration (frame rate, channels, etc.)
Autor:
ken
  • Feldübersicht

    Felder
    Modifizierer und Typ
    Feld
    Beschreibung
    private int
     
    private int
     
    private final int
     
    private final int
     
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    AudioConfig(int frameRate, int channels, Integer audioBufferSize)
    This instance represents the requested audio configuration.
    AudioConfig(IAudioSection audioSection)
    Return a detached AudioConfig instance corresponding to current parameters.
    Note: The number of audio channels is always two to support stereo tunes and to play mono tunes as stereo (fake stereo).
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    final int
    Gets the size of this AudioConfig's audio buffer in frames.
    final int
    Get number of audio channels
    final int
    Return the desired size of buffer used at one time.
    static final int
    Note: Java Linux ALSA Sound System is awful!
    final int
    Gets the audio frame rate of this AudioConfig.
    final void
    setAudioBufferSize(int audioBufferSize)
     
    final void
    setBufferFrames(int bufferFrames)
    The actual buffer size for the open audio line may differ from the requested buffer size, therefore the setter
    Note: We make the sample buffer size divisible by 64 to ensure that all fast forward factors can be handled. (32x speed, 2 channels).
    Note: Must be greater or equal than the calculated chunk size!

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Felddetails

    • frameRate

      private final int frameRate
    • channels

      private final int channels
    • audioBufferSize

      private int audioBufferSize
    • bufferFrames

      private int bufferFrames
  • Konstruktordetails

    • AudioConfig

      public AudioConfig(IAudioSection audioSection)
      Return a detached AudioConfig instance corresponding to current parameters.
      Note: The number of audio channels is always two to support stereo tunes and to play mono tunes as stereo (fake stereo).
      Parameter:
      audioSection - audio configuration
    • AudioConfig

      public AudioConfig(int frameRate, int channels, Integer audioBufferSize)
      This instance represents the requested audio configuration.
      Parameter:
      frameRate - The desired audio frame rate.
      channels - The number of audio channels to use.
      audioBufferSize - The audio buffer size.
  • Methodendetails

    • getFrameRate

      public final int getFrameRate()
      Gets the audio frame rate of this AudioConfig.
      Gibt zurück:
      The audio frame rate of this AudioConfig.
    • getChunkFrames

      public final int getChunkFrames()
      Return the desired size of buffer used at one time. This is often smaller than the whole buffer because doing this allows us to stay closer in sync with the audio production. Note:Do not choose too small values here: test with 96kHz and 32x fast forward! Note: Current implementation uses exactly the same size as bufferFrames as a result after numerous tests!
      Gibt zurück:
      size of one chunk
    • getBufferFrames

      public final int getBufferFrames()
      Gets the size of this AudioConfig's audio buffer in frames.
      Gibt zurück:
      The size of this AudioConfig's audio buffer in frames.
    • setBufferFrames

      public final void setBufferFrames(int bufferFrames)
      The actual buffer size for the open audio line may differ from the requested buffer size, therefore the setter
      Note: We make the sample buffer size divisible by 64 to ensure that all fast forward factors can be handled. (32x speed, 2 channels).
      Note: Must be greater or equal than the calculated chunk size!
      Parameter:
      bufferFrames - available buffer frames
    • setAudioBufferSize

      public final void setAudioBufferSize(int audioBufferSize)
    • getChannels

      public final int getChannels()
      Get number of audio channels
      Gibt zurück:
      audio channels
    • getDefaultBufferSize

      public static final int getDefaultBufferSize()
      Note: Java Linux ALSA Sound System is awful!
      Best results after numerous tests (Win/Linux, Java 8/11, 44.1K..96K, 1x..32x fast forward)
      1024=responsiveness vs. 16384=stable audio since Java11 on Linux
      Gibt zurück:
      platform dependent default buffer size