Class OmniRealtimeAudioFormatConfig

java.lang.Object
com.alibaba.dashscope.legacy_2x.audio.omni.OmniRealtimeAudioFormatConfig

@Deprecated public class OmniRealtimeAudioFormatConfig extends Object
Deprecated.
New-style upstream/downstream audio format configuration, used to build the nested audio.input.format / audio.output.format structure in the session.update request, e.g.

 "session": {
   "audio": {
     "input": { "format": { "type": "pcm", "sample_rate": 16000 } },
     "output": { "format": { "type": "pcm", "sample_rate": 24000 } }
   }
 }
 
  • Constructor Details

    • OmniRealtimeAudioFormatConfig

      public OmniRealtimeAudioFormatConfig()
      Deprecated.
    • OmniRealtimeAudioFormatConfig

      public OmniRealtimeAudioFormatConfig(OmniRealtimeAudioCodec type, int sampleRate)
      Deprecated.
      Creates a new audio format config.
      Parameters:
      type - audio format type
      sampleRate - sample rate in Hz, must be one of 8000/16000/24000/48000
    • OmniRealtimeAudioFormatConfig

      public OmniRealtimeAudioFormatConfig(String type, int sampleRate)
      Deprecated.
      Creates a new audio format config.
      Parameters:
      type - "pcm" or "wav"
      sampleRate - sample rate in Hz, must be one of 8000/16000/24000/48000
  • Method Details

    • setType

      public void setType(OmniRealtimeAudioCodec type)
      Deprecated.
    • setSampleRate

      public void setSampleRate(int sampleRate)
      Deprecated.
    • of

      public static OmniRealtimeAudioFormatConfig of(String type, int sampleRate)
      Deprecated.
      Creates a new audio format config, convenience factory method equivalent to new OmniRealtimeAudioFormatConfig(type, sampleRate).
      Parameters:
      type - "pcm" or "wav"
      sampleRate - sample rate in Hz, must be one of 8000/16000/24000/48000
      Returns:
      the created config
    • addParameter

      public OmniRealtimeAudioFormatConfig addParameter(String key, Object value)
      Deprecated.
      Adds a single extra format parameter for future extension (e.g. addParameter("rate", 1.2) for speech rate). Merged into the format node when serialized.
      Parameters:
      key - parameter name
      value - parameter value
      Returns:
      this config for chaining
    • getType

      public OmniRealtimeAudioCodec getType()
      Deprecated.
      audio format type, supports "pcm" and "wav", defaults to "pcm".
    • getSampleRate

      public int getSampleRate()
      Deprecated.
      sample rate in Hz, supports 8000/16000/24000/48000, defaults to 16000.
    • getParameters

      public Map<String,Object> getParameters()
      Deprecated.
      Extra format parameters for future extension (e.g. speech rate). These entries are merged into the format node alongside type/sample_rate when serialized, so new server-side parameters can be passed through without changing this SDK. Reserved keys ( type/sample_rate) set here are ignored to avoid overriding the typed fields.
    • setParameters

      public void setParameters(Map<String,Object> parameters)
      Deprecated.
      Extra format parameters for future extension (e.g. speech rate). These entries are merged into the format node alongside type/sample_rate when serialized, so new server-side parameters can be passed through without changing this SDK. Reserved keys ( type/sample_rate) set here are ignored to avoid overriding the typed fields.
    • equals

      public boolean equals(Object o)
      Deprecated.
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
      Deprecated.
    • hashCode

      public int hashCode()
      Deprecated.
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object