我编写了一个应用程序,通过TCP从客户端到服务器传输音频,但它不起作用,即没有声音输出.你能检查我的代码告诉我它有什么问题吗?
客户:
public void startStreaming() {
Thread streamThread = new Thread(new Runnable() {
@Override
public void run() {
try {
int minBufSize =AudioRecord.getMinBufferSize(sampleRate, channelConfig, audioFormat);
Log.d("VD ", "Bufer intioalised "+minBufSize);
short[] buffer=new short[minBufSize];
Log.d("VS","Buffer created of size .c" + minBufSize);
// DatagramPacket packet;
final InetAddress destination = InetAddress.getByName(target.getText().toString());
port=Integer.parseInt(target_port.getText().toString());
Socket socket=new Socket(destination,port);
DataOutputStream dos=new DataOutputStream(new BufferedOutputStream(socket.getOutputStream()