OpusEncoder
public class OpusEncoder : NSObject
Opus用のエンコーダークラス。
-
エンコード時の帯域のデフォルト値(
.fb20000Hz)。Declaration
Swift
public static let DEFAULT_BANDWIDTH: OpusHeader.BandWidth -
エンコード時のフレームサイズのデフォルト値( 20ms )。
Declaration
Swift
public static let DEFAULT_FRAME_DURATION: OpusHeader.FrameDuration -
エンコード時のビットレートのデフォルト値( 64000 )。
Declaration
Swift
public static let DEFAULT_BIT_RATE: Int -
エンコード時のチャンネル数のデフォルト値( 1チャンネル )。
Declaration
Swift
public static let DEFAULT_CHANNELS: Int -
オブジェクトを識別するためのタグ。
Declaration
Swift
public var tag: Int -
このクラスが使用する Delegate。
Declaration
Swift
public weak var delegate: OpusEncoderDelegate? -
入力に使用した音声フォーマット。
Declaration
Swift
public private(set) var inputFormatDesc: AudioStreamBasicDescription? { get } -
出力される音声フォーマット。
Declaration
Swift
public private(set) var outputFormatDesc: AudioStreamBasicDescription? { get } -
帯域幅。
Declaration
Swift
public let bandWidth: OpusHeader.BandWidth -
サンプリングレート。
Declaration
Swift
public var sampleRate: Double { get } -
1フレームの長さ。
Declaration
Swift
public var frameDuration: OpusHeader.FrameDuration -
ビットレート。
Declaration
Swift
public private(set) var bitRate: Int { get } -
チャンネル数。
Declaration
Swift
public let channels: Int -
OpusEncoder を生成します。
Declaration
Swift
public init(bandWidth: OpusHeader.BandWidth = OpusEncoder.DEFAULT_BANDWIDTH, frameDuration: OpusHeader.FrameDuration = OpusEncoder.DEFAULT_FRAME_DURATION, bitRate: Int = OpusEncoder.DEFAULT_BIT_RATE, channels: Int = OpusEncoder.DEFAULT_CHANNELS)Parameters
bandWidth帯域幅
frameDuration1フレームの長さ
bitRateビットレート
channelsチャンネル数
-
エンコードしたい音声サンプルを追加します。
Declaration
Swift
public func appendSampleBuffer(sampleBuffer: CMSampleBuffer, timestamp: TimeInterval)Parameters
sampleBufferエンコードしたい音声サンプルを格納したバッファー
入力するサンプルバッファーの音声フォーマットはpcmFloat32のみサポートしています。timestampタイムスタンプ
-
ビットレートを設定します。
Declaration
Swift
public func set(bitRate: Int)Parameters
bitRateビットレート
-
初期状態にリセットします。
Declaration
Swift
public func reset() -
割り当てを解除します。
Declaration
Swift
public func dispose()
OpusEncoder Class Reference