Package ej.audio.sink
Class MockDefaultAudioSink
java.lang.Object
ej.audio.sink.MockDefaultAudioSink
- All Implemented Interfaces:
MockAudioSink
The default implementation of
MockAudioSink.
Avoid direct instantiation with new, use MockAudioSinkFactory.getInstance(int, byte[], int[], int)
instead.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final byte[]protected final int[]Fields inherited from interface ej.audio.sink.MockAudioSink
MAX_FRAME_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionMockDefaultAudioSink(int resourceId, byte[] formatEncoding, int[] formatParameters, int bufferSize) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intgetLine()getPipe()intvoidsetVolume(float gain) voidstart()booleanwaitForBufferFlushed(int timeout) intwriteBuffer(byte[] array, int offset, int size, int timeout)
-
Field Details
-
formatEncoding
protected final byte[] formatEncoding -
formatParameters
protected final int[] formatParameters
-
-
Constructor Details
-
MockDefaultAudioSink
public MockDefaultAudioSink(int resourceId, byte[] formatEncoding, int[] formatParameters, int bufferSize) throws ej.sni.NativeIOException - Throws:
ej.sni.NativeIOException
-
-
Method Details
-
getResourceId
public int getResourceId()- Specified by:
getResourceIdin interfaceMockAudioSink
-
getBufferSize
public int getBufferSize()- Specified by:
getBufferSizein interfaceMockAudioSink
-
getPipe
-
getLine
-
setVolume
public void setVolume(float gain) - Specified by:
setVolumein interfaceMockAudioSink
-
writeBuffer
public int writeBuffer(byte[] array, int offset, int size, int timeout) throws ej.sni.NativeIOException - Specified by:
writeBufferin interfaceMockAudioSink- Throws:
ej.sni.NativeIOException
-
waitForBufferFlushed
public boolean waitForBufferFlushed(int timeout) - Specified by:
waitForBufferFlushedin interfaceMockAudioSink
-
start
public void start() throws ej.sni.NativeIOException- Specified by:
startin interfaceMockAudioSink- Throws:
ej.sni.NativeIOException
-
close
public void close()- Specified by:
closein interfaceMockAudioSink
-