I try the code in Internet : https://www.hackster.io/julianfschroete ... e#comments and I build the server on android telephone as following showed:
Code: Select all
serverSocket = new ServerSocket(socketServerPORT);
Socket socket = serverSocket.accept();
AudioTrack at = new AudioTrack(AudioManager.STREAM_MUSIC, 8000, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, minBufferSize, AudioTrack.MODE_STREAM);
......
DataInputStream dis = new DataInputStream(socket.getInputStream());
while ((i = dis.read(s, 0, minBufferSize)) > -1)
{
at.write(s, 0, i);
}
Besides noicy the problem is the sound starts almost intellegible and via via worst and become only rumors.
Please somebody can give me an help. Thanks