WOWZAudioSink

Extends Protocol:
Declared In:

Introduction

WOWZAudioSink defines a protocol for callbacks that occur when audio samples are captured or audio levels change.



Methods

-audioFrameWasCaptured:size:time:sampleRate:
-audioLevelDidChange:
-audioPCMFrameWasCaptured:bufferList:time:sampleRate:
-canConvertStreamWithDescription:

audioFrameWasCaptured:size:time:sampleRate:


@optional

- (void) audioFrameWasCaptured:(nonnull void *)data size:(uint32_t)size time:(CMTime)time sampleRate:(Float64)sampleRate;
Parameters
data

The audio sample data.

size

The size, in bytes, of the captured sample.

time

The audio sample time, represented in a CMTime structure.

sampleRate

The audio sample rate.

Discussion

Called for each recorded audio sample. The format of the data is uninteresting to the protocol adopter; use audioFrameWasCaptured only for timing information. To access raw audio data, use the audioPCMFrameWasCaptured protocol method.


audioLevelDidChange:


@optional

- (void) audioLevelDidChange:(float)level;
Parameters
level

The audio level.

Discussion

Called when the audio level value changes.


audioPCMFrameWasCaptured:bufferList:time:sampleRate:


@optional

- (void) audioPCMFrameWasCaptured:(nonnull const AudioStreamBasicDescription *)pcmASBD bufferList:(nonnull const AudioBufferList *)bufferList time:(CMTime)time sampleRate:(Float64)sampleRate;
Parameters
pcmASBD

The AudioStreamBasicDescription of the PCM data.

bufferList

The AudioBufferList representation of the PCM data.

time

The audio sample time, represented in a CMTime structure.

sampleRate

The audio sample rate.

Discussion

Called for each recorded audio sample. Instructs the SDK to convert audio from PCM to AAC before broadcasting. Do NOT implement this protocol unless you specifically need the unencoded audio data. When audioPCMFrameWasCaptured is used, the audioFrameWasCaptured protocol method isn't called. However, if the audio converter can't convert from PCM to AAC, then the capture hardware will fall back to capturing AAC directly and the audioFrameWasCaptured protocol will be called instead.


canConvertStreamWithDescription:


@optional

- (BOOL) canConvertStreamWithDescription:(nonnull const AudioStreamBasicDescription *)asbd;
Parameters
asbd

The AudioStreamBasicDescription of the format being converted.

Return Value

True if the format can be converted; false otherwise.

Discussion

Tests whether the audio sink adopting this protocol can convert from the specified format description. It would be very unusual for a client to implement this protocol, which is implemented by the WOWZAACEncoder class.