类 OpusUtils

java.lang.Object
com.tencent.tts.utils.OpusUtils

public class OpusUtils
extends java.lang.Object
  • 构造器概要

    构造器 
    构造器 说明
    OpusUtils()  
  • 方法概要

    修饰符和类型 方法 说明
    static int convertGoByte2Int​(byte[] bytes)
    这里需要注意golang的byte是uint8 java是int8 不能使用BytesReader的toInt方法转换
    static int getUint8​(short s)  
    static boolean read​(java.io.InputStream in, byte[] buffer)
    读取数据
    static java.util.List<byte[]> readOpusSheet​(byte[] audio)
    解析opus
    static boolean verifyHeader​(byte[] headBuffer)
    验证 opus header

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

  • 方法详细资料

    • convertGoByte2Int

      public static int convertGoByte2Int​(byte[] bytes)
      这里需要注意golang的byte是uint8 java是int8 不能使用BytesReader的toInt方法转换
      参数:
      bytes -
      返回:
      uint8 数据
    • getUint8

      public static int getUint8​(short s)
    • verifyHeader

      public static boolean verifyHeader​(byte[] headBuffer)
      验证 opus header
      参数:
      headBuffer -
      返回:
      是否正确
    • read

      public static boolean read​(java.io.InputStream in, byte[] buffer) throws java.io.IOException
      读取数据
      参数:
      in -
      buffer -
      返回:
      是否成功
      抛出:
      java.io.IOException
    • readOpusSheet

      public static java.util.List<byte[]> readOpusSheet​(byte[] audio)
      解析opus
      参数:
      audio - audio
      返回:
      List