Package client.teavm.common.audio
Klasse AudioDriverTeaVM
java.lang.Object
client.teavm.common.audio.AudioDriverTeaVM
- Alle implementierten Schnittstellen:
Consumer<VIC>,SIDListener,AudioDriver,VideoDriver
Audio driver to be used in the JavaScript and web assembly version builds.
Browser needs float array for each channel with sound samples with a value
range of -1..1. And pixel data is required as a byte array containing color
data four bytes each pixel RGBA. Additionally the possibility to sniff for
SID writes helps to make USB hardware working in the browser and for debug
purposes.
Note: A lookup table is used for sample data conversion (short to
float) for performance reasons
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprivate EventSchedulerprivate final Engineprivate intprivate final IImportedApiprivate longprivate final float[]private final Mixerprivate intprivate final intprivate final byte[]private static final shortprivate FloatBufferprivate FloatBufferprivate ByteBufferprivate ShortBuffer -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungAudioDriverTeaVM(IImportedApi importedApi, float[] lookupTable, Mixer mixer, Engine engine, PALEmulationTeaVM palEmulation) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidPropagates VIC pixel data for video drivers.
Pixels can be accessed using vic.getPALEmulation().getPixels() Note: Pixel format is ARGB and is updated frequently at a rate of screen refresh rate.buffer()Return the bytebuffer intended to hold the audio data.private intclocksSinceLastAccess(long now) voidclose()Free the audio device.private longbooleanvoidopen(IAudioSection audioSection, String recordingFilename, CPUClock cpuClock, EventScheduler context) Open audio interface.voidwrite()Write the complete contents of ByteBuffer to audio device.voidwrite(int addr, byte data) voidVon Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden sidplay.audio.AudioDriver
getExtension, lookup, pause
-
Felddetails
-
REGULAR_DELAY
private static final short REGULAR_DELAY- Siehe auch:
-
importedApi
-
lookupTable
private final float[] lookupTable -
mixer
-
engine
-
nthFrame
private final int nthFrame -
pixelsArray
private final byte[] pixelsArray -
context
-
sampleBuffer
-
shortBuffer
-
resultL
-
resultR
-
n
private int n -
lastSIDWriteTime
private long lastSIDWriteTime -
fastForwardVICFrames
private int fastForwardVICFrames
-
-
Konstruktordetails
-
AudioDriverTeaVM
public AudioDriverTeaVM(IImportedApi importedApi, float[] lookupTable, Mixer mixer, Engine engine, PALEmulationTeaVM palEmulation)
-
-
Methodendetails
-
open
public void open(IAudioSection audioSection, String recordingFilename, CPUClock cpuClock, EventScheduler context) throws IOException, LineUnavailableException, InterruptedException Beschreibung aus Schnittstelle kopiert:AudioDriverOpen audio interface.- Angegeben von:
openin SchnittstelleAudioDriver- Parameter:
audioSection- audio configurationrecordingFilename- name for a recordingcpuClock- CPU clockcontext- event context- Löst aus:
IOExceptionLineUnavailableExceptionInterruptedException
-
write
Beschreibung aus Schnittstelle kopiert:AudioDriverWrite the complete contents of ByteBuffer to audio device.- Angegeben von:
writein SchnittstelleAudioDriver- Löst aus:
InterruptedException
-
writeRemaining
- Löst aus:
InterruptedException
-
close
public void close()Beschreibung aus Schnittstelle kopiert:AudioDriverFree the audio device. (Counterpart of open().)- Angegeben von:
closein SchnittstelleAudioDriver
-
buffer
Beschreibung aus Schnittstelle kopiert:AudioDriverReturn the bytebuffer intended to hold the audio data. The audio data is in interleaved format and has as many channels as given by the result of open(). Use putShort() to write 16-bit values. Don't call write() until you have filled the entire buffer with audio.- Angegeben von:
bufferin SchnittstelleAudioDriver- Gibt zurück:
- The buffer to write audio to.
-
isRecording
public boolean isRecording()- Angegeben von:
isRecordingin SchnittstelleAudioDriver- Gibt zurück:
- is this audio driver recording tunes?
-
accept
Beschreibung aus Schnittstelle kopiert:VideoDriverPropagates VIC pixel data for video drivers.
Pixels can be accessed using vic.getPALEmulation().getPixels() Note: Pixel format is ARGB and is updated frequently at a rate of screen refresh rate.CPUClock.getScreenRefresh()- Angegeben von:
acceptin SchnittstelleConsumer<VIC>- Angegeben von:
acceptin SchnittstelleVideoDriver
-
write
public void write(int addr, byte data) - Angegeben von:
writein SchnittstelleSIDListener
-
clocksSinceLastAccess
private int clocksSinceLastAccess(long now) -
eventuallyDelay
private long eventuallyDelay()
-