Streaming audio from microphone with Java

前端 未结 2 881
渐次进展
渐次进展 2020-12-30 17:43

I\'m developing a project which requires me to stream audio from microphone from a client to a server. The code shown below is what I have written. When I run both the clie

2条回答
  •  自闭症患者
    2020-12-30 18:12

    The problem is in client side, in the line

    byte[] data = IOUtils.toByteArray(is);

    It deals with the object itself, not with the content. So, you must change it to this:

    byte[] data = new byte[1024];

提交回复
热议问题