类 AudioPlayer.Builder

java.lang.Object
io.agentscope.core.model.tts.AudioPlayer.Builder
封闭类:
AudioPlayer

public static class AudioPlayer.Builder extends Object
Builder for constructing AudioPlayer instances.
  • 构造器详细资料

    • Builder

      public Builder()
  • 方法详细资料

    • sampleRate

      public AudioPlayer.Builder sampleRate(int sampleRate)
      Sets the sample rate in Hz.
      参数:
      sampleRate - sample rate (e.g., 16000, 24000, 48000)
      返回:
      this builder
    • sampleSizeInBits

      public AudioPlayer.Builder sampleSizeInBits(int sampleSizeInBits)
      Sets the sample size in bits.
      参数:
      sampleSizeInBits - bits per sample (e.g., 8, 16)
      返回:
      this builder
    • channels

      public AudioPlayer.Builder channels(int channels)
      Sets the number of audio channels.
      参数:
      channels - 1 for mono, 2 for stereo
      返回:
      this builder
    • signed

      public AudioPlayer.Builder signed(boolean signed)
      Sets whether the audio data is signed.
      参数:
      signed - true for signed, false for unsigned
      返回:
      this builder
    • bigEndian

      public AudioPlayer.Builder bigEndian(boolean bigEndian)
      Sets the byte order of the audio data.
      参数:
      bigEndian - true for big-endian, false for little-endian
      返回:
      this builder
    • build

      public AudioPlayer build()
      Builds the AudioPlayer instance.
      返回:
      a configured AudioPlayer