OpusDecoder

public class OpusDecoder : NSObject

Opus用のデコーダークラス。

  • デコード時の音声フォーマットのデフォルト値( .pcmFloat32 )。

    Declaration

    Swift

    public static let DEFAULT_DECODE_FORMAT: IntdashAudioFormat
  • デコード時のサンプリングレートのデフォルト値( 48000 )。

    Declaration

    Swift

    public static let DEFAULT_DECODE_SAMPLE_RATE: Double
  • デコード時の音声フォーマット。

    Declaration

    Swift

    public let decodeFormat: IntdashAudioFormat
  • デコード時のサンプリングレート。

    Declaration

    Swift

    public let decodeSampleRate: Double
  • tag

    オブジェクトを識別するためのタグ。

    Declaration

    Swift

    public var tag: Int
  • このクラスが使用する Delegate。

    Declaration

    Swift

    public weak var delegate: OpusDecoderDelegate?
  • このクラスが使用する Delegate。

    Declaration

    Swift

    public weak var sampleParseDelegate: OpusDecoderSampleParseDelegate?
  • 入力に使用した音声フォーマット。

    Declaration

    Swift

    public private(set) var inputFormatDesc: AudioStreamBasicDescription?
  • 出力される音声フォーマット。

    Declaration

    Swift

    public private(set) var outputFormatDesc: AudioStreamBasicDescription?
  • Opusヘッダー。

    Declaration

    Swift

    public private(set) var opusHeader: OpusHeader?
  • OpusDecoder を生成します。

    Declaration

    Swift

    public init(decodeFormat: IntdashAudioFormat = OpusDecoder.DEFAULT_DECODE_FORMAT, decodeSampleRate: Double = OpusDecoder.DEFAULT_DECODE_SAMPLE_RATE)

    Parameters

    decodeFormat

    デコード時の音声フォーマット

    decodeSampleRate

    デコード時のサンプルレート

  • OpusDecoder を生成します。

    Declaration

    Swift

    public init(commonFormat: AVAudioCommonFormat, decodeSampleRate: Double = OpusDecoder.DEFAULT_DECODE_SAMPLE_RATE) throws

    Parameters

    commonFormat

    デコード時の音声フォーマット

    decodeSampleRate

    デコード時のサンプリングレート

  • デコードしたい音声サンプルを追加します。

    Declaration

    Swift

    public func appendAudioSamples(sampleData: Data, timestamp: TimeInterval = -1)

    Parameters

    sampleData

    エンコードされた音声サンプル(Opusのフレーム)

    timestamp

    タイムスタンプ

  • 初期状態にリセットします。

    Declaration

    Swift

    public func reset()
  • 割り当てを解除します。

    Declaration

    Swift

    public func dispose()