VKAudioDecoder Class Reference

Inherits from VKDecoder : VKQueue : NSObject
Declared in VKAudioDecoder.h

Overview

VKAudioDecoder is responsible for decoding & resampling of audio packets, and making audio effects

– initWithFormatContext:codecContext:stream:streamId:manager:

Initialize VKAudioDecoder object with AVCodecContext, AVStream, stream, and index parameters

- (id)initWithFormatContext:(AVFormatContext *)avFmtCtx codecContext:(AVCodecContext *)cdcCtx stream:(AVStream *)strm streamId:(NSInteger)sId manager:(id)manager

Parameters

cdcCtx

FFmpeg’s codec I/O context

strm

FFmpeg’s Stream structure

sId

Stream index

manager

VKDecodeManager object

Return Value

VKAudioDecoder object

Declared In

VKAudioDecoder.h

– shutdown

Shutdown audio decoder

- (void)shutdown

Declared In

VKAudioDecoder.h

– unlockQueues

Queues are interworking with eachother and uses wait mechanism for management, this methods unlocks all queues

- (void)unlockQueues

Declared In

VKAudioDecoder.h

– startAUGraph

Start AUGraph

- (void)startAUGraph

Declared In

VKAudioDecoder.h

– stopAUGraph

Stop AUGraph

- (void)stopAUGraph

Declared In

VKAudioDecoder.h

– startAudioSystem

Start Audio Subsystem

- (void)startAudioSystem

Declared In

VKAudioDecoder.h

– stopAudioSystem

Stop Audio Subsystem

- (void)stopAudioSystem

Declared In

VKAudioDecoder.h

– setEOF:

Inform Audio Decoder that it’s reached end of file

- (void)setEOF:(BOOL)value

Parameters

value

Specify YES for end of file is reached or NO for continue playing

Declared In

VKAudioDecoder.h

  isWaitingForPackets

Buffering is based on whather the queue has audio packets or not, so this property indicates this state

@property (nonatomic, readonly) BOOL isWaitingForPackets

Declared In

VKAudioDecoder.h

  currentPtsDrift

Time difference of current PTS value and now

@property (nonatomic, readonly) double currentPtsDrift

Declared In

VKAudioDecoder.h

  currentPos

Current byte position of AVPacket in stream, used for AV syncing

@property (nonatomic, readonly) int64_t currentPos

Declared In

VKAudioDecoder.h

  volumeLevel

This a gain volume effect which must be between 0.0 - 1.0, default value is 1.0

@property (nonatomic, assign) float volumeLevel

Discussion

volumeLevel does not have any effect on MPVolumeView

Declared In

VKAudioDecoder.h

  panningLevel

This is a channel panning effect which must be between -1.0 (all audio is routed to left channel) and +1.0 (all audio is routed to right channel), default value is 0.0 which means no panning (audio is routed to both left & right channels)

@property (nonatomic, assign) float panningLevel

Declared In

VKAudioDecoder.h