int CHUNKED_SIZE = 8000;
public void recognizeText(byte[] data) throws InterruptedException, IOException {

        init();

        byte[] buffer = new byte[CHUNKED_SIZE];

        ByteArrayInputStream stream = new ByteArrayInputStream(data);

        while (stream.read(buffer) != -1)
        {
            send(buffer);
        }
        send("EOS");
    }

String fileName = "F:\\aaa.wav";
RandomAccessFile raf = new RandomAccessFile(fileName,"r");
raf.skipBytes(44);
byte [] audioData = new byte[(int)(raf.length() - 44)];
raf.readFully(audioData);
recognizeText(audioData);

每次读取8000字节

相关文章:

  • 2021-06-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
  • 2022-12-23
  • 2021-06-08
  • 2021-11-23
猜你喜欢
  • 2022-12-23
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-06-15
  • 2021-11-18
相关资源
相似解决方案