Package builder.resid
Klasse SIDMixer
java.lang.Object
builder.resid.SIDMixer
- Alle implementierten Schnittstellen:
Mixer
- Bekannte direkte Unterklassen:
ReSIDBuilder
Mixer to mix SIDs sample data into the audio buffer.
- Autor:
- ken
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungprivate final classThe mixer mixes the generated sound samples into the drivers audio buffer. -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprivate IntBufferAudio buffers for two channels (stereo).private IntBufferAudio buffers for two channels (stereo).private AudioDriverAudio driverprivate List<AudioProcessor> Add some audio post processing.private ByteBufferAudio driver buffer.private intCapacity of the Audio buffers audioBufferL and audioBufferR.private CartridgeCartridge that could possibly add sound to the mixprotected final IConfigConfigurationprotected final EventSchedulerSystem event context.protected final CPUClockCPU clock.private final int[]Delay in samples of all SIDs.private int[]private final booleanFade-in/fade-out enabled.private final SIDMixer.MixerEventMixer clocking SID chips and producing audio output.private final float[]SID audibility on the left speaker of all SIDs 0(silent)..1(loud).private final float[]SID audibility on the right speaker of all SIDs 0(silent)..1(loud).private final ResamplerResampler of sample output for two channels (stereo).private final ResamplerResampler of sample output for two channels (stereo).SIDs to mix their sound output.private final int[]Volume of all SIDs.(Package privat) static final intScaler to use fast int multiplication while setting volume.private booleanWhatsSid enabled?private final WhatsSidSupportWhatsSIDVon Schnittstelle geerbte Felder libsidplay.common.Mixer
MAX_FAST_FORWARD -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungSIDMixer(EventScheduler context, IConfig config, CPUClock cpuClock, Cartridge cart) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidAdd a SID to the mix.private SampleMixercreateSampleMixer(IntBuffer intBufferL, IntBuffer intBufferR) Create a new sample value mixer.static intdecibelsToCentibels(float decibel) Decibel to centibel conversion.voidfadeIn(double fadeIn) Fade-in start time reached, audio volume should be increased to the max.voidfadeOut(double fadeOut) Fade-out start time reached, audio volume should be lowered to zero.voidDoubles speed factor.intprivate booleanbooleanvoidUse normal speed factor.voidRemove SID from the mix.voidsetAudioDriver(AudioDriver audioDriver) Set audio driver for mixingvoidsetBalance(int sidNum, float balance) Set left/right speaker balance for each SID.voidsetDelay(int sidNum, int delay) Delay feature: Delaying SID chip sound samples by time in millisecondsvoidsetVolume(int sidNum, float volumeInDB) Volume of the SID chip.
Note: The decibel (dB) value is a ratio used for comparing and calculating levels of change in power and is not the power itself.voidsetWhatsSidEnabled(boolean whatsSidEnabled) voidstart()Starts mixing the outputs of several SIDs.private voidSet the sample mixer volume to the calculated balanced volume level.
Mono output: Use volume.
Stereo or 3-SID output: Use speaker audibility and volume.
-
Felddetails
-
VOLUME_SCALER
static final int VOLUME_SCALERScaler to use fast int multiplication while setting volume.- Siehe auch:
-
context
System event context. -
config
Configuration -
cpuClock
CPU clock. -
sids
SIDs to mix their sound output. -
cart
Cartridge that could possibly add sound to the mix -
mixerAudio
Mixer clocking SID chips and producing audio output. -
audioBufferL
Audio buffers for two channels (stereo). -
audioBufferR
Audio buffers for two channels (stereo). -
bufferSize
private int bufferSizeCapacity of the Audio buffers audioBufferL and audioBufferR. -
emptyBuffer
private int[] emptyBuffer -
resamplerL
Resampler of sample output for two channels (stereo). -
resamplerR
Resampler of sample output for two channels (stereo). -
audioDriver
Audio driver -
volume
private final int[] volumeVolume of all SIDs. -
positionL
private final float[] positionLSID audibility on the left speaker of all SIDs 0(silent)..1(loud). -
positionR
private final float[] positionRSID audibility on the right speaker of all SIDs 0(silent)..1(loud). -
delayInSamples
private final int[] delayInSamplesDelay in samples of all SIDs. -
fadeInFadeOutEnabled
private final boolean fadeInFadeOutEnabledFade-in/fade-out enabled. -
whatsSidEnabled
private boolean whatsSidEnabledWhatsSid enabled? -
whatsSidSupport
WhatsSID -
audioProcessors
Add some audio post processing. -
buffer
Audio driver buffer.
-
-
Konstruktordetails
-
SIDMixer
-
-
Methodendetails
-
setAudioDriver
Set audio driver for mixing -
start
public void start()Starts mixing the outputs of several SIDs. -
fadeIn
public void fadeIn(double fadeIn) Fade-in start time reached, audio volume should be increased to the max. -
fadeOut
public void fadeOut(double fadeOut) Fade-out start time reached, audio volume should be lowered to zero. -
add
Add a SID to the mix.- Parameter:
sidNum- SID chip numbersid- SID to add
-
remove
Remove SID from the mix.- Parameter:
sid- SID to remove
-
setVolume
public void setVolume(int sidNum, float volumeInDB) Volume of the SID chip.
Note: The decibel (dB) value is a ratio used for comparing and calculating levels of change in power and is not the power itself. So if we have two quantities of power, for example: P1 and P2, the ratio of these two values is represented by the equation:
dB = 10log10[P2/P1]
If P2/P1 is equal to 1, that is P1 = P2 then:
dB = 10log10[1] = log10[1/10] -
decibelsToCentibels
public static int decibelsToCentibels(float decibel) Decibel to centibel conversion.- Parameter:
decibel- decibel value- Gibt zurück:
- centibel value
-
setBalance
public void setBalance(int sidNum, float balance) Set left/right speaker balance for each SID.- Angegeben von:
setBalancein SchnittstelleMixer- Parameter:
sidNum- SID chip numberbalance- balance 0(left speaker)..0.5(centered)..1(right speaker)
-
setDelay
public void setDelay(int sidNum, int delay) Delay feature: Delaying SID chip sound samples by time in milliseconds -
createSampleMixer
Create a new sample value mixer.- Parameter:
intBufferL- buffer of left speakerintBufferR- buffer of right speaker
-
updateSampleMixerVolume
private void updateSampleMixerVolume()Set the sample mixer volume to the calculated balanced volume level.
Mono output: Use volume.
Stereo or 3-SID output: Use speaker audibility and volume. -
isFakeStereo
private boolean isFakeStereo()- Gibt zurück:
- is fake stereo enabled?
-
fastForward
public void fastForward()Doubles speed factor.- Angegeben von:
fastForwardin SchnittstelleMixer
-
normalSpeed
public void normalSpeed()Use normal speed factor.- Angegeben von:
normalSpeedin SchnittstelleMixer
-
isFastForward
public boolean isFastForward()- Angegeben von:
isFastForwardin SchnittstelleMixer- Gibt zurück:
- speed factor is used?
-
getFastForwardBitMask
public int getFastForwardBitMask()- Angegeben von:
getFastForwardBitMaskin SchnittstelleMixer- Gibt zurück:
- bit mask of current speed factor (1 << 0 = 1x, 1 << 1 = 2x, ... , 1 << 5 = 32x) - 1
-
getWhatsSidSupport
-
setWhatsSidEnabled
public void setWhatsSidEnabled(boolean whatsSidEnabled)
-