Package ej.audio.sink
Class TcpAudioSender
java.lang.Object
ej.audio.sink.TcpAudioSender
Streams decoded PCM audio frames to a remote TCP server.
Used to bypass the physical audio loopback during simulator testing: the decoded PCM bytes that are written to a
SourceDataLine are also forwarded directly to a remote server for audio quality analysis.
-
Constructor Summary
ConstructorsConstructorDescriptionTcpAudioSender(String host, int port) Creates aTcpAudioSenderconnected to the given host and port. -
Method Summary
-
Constructor Details
-
TcpAudioSender
Creates aTcpAudioSenderconnected to the given host and port.- Parameters:
host- the TCP server IP address or hostname.port- the TCP server port.- Throws:
IOException- if the connection cannot be established.
-
-
Method Details
-
send
public void send(byte[] data, int offset, int length) Sends the given PCM audio bytes to the TCP server.- Parameters:
data- the buffer containing the audio data.offset- the start offset in the buffer.length- the number of bytes to send.
-
close
public void close()Closes the TCP connection, signaling end-of-stream to the remote server.
-