Package sidplay.audio
Klasse AudioConfig
java.lang.Object
sidplay.audio.AudioConfig
Audio configuration (frame rate, channels, etc.)
- Autor:
- ken
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprivate intprivate intprivate final intprivate final int -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungAudioConfig(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 TypMethodeBeschreibungfinal intGets the size of this AudioConfig's audio buffer in frames.final intGet number of audio channelsfinal intReturn the desired size of buffer used at one time.static final intNote: Java Linux ALSA Sound System is awful!final intGets the audio frame rate of this AudioConfig.final voidsetAudioBufferSize(int audioBufferSize) final voidsetBufferFrames(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!
-
Felddetails
-
frameRate
private final int frameRate -
channels
private final int channels -
audioBufferSize
private int audioBufferSize -
bufferFrames
private int bufferFrames
-
-
Konstruktordetails
-
AudioConfig
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
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
-