OTAudioBus
The audio bus marshals audio data between the network and the audio device. Call the [OTAudioDevice setAudioBus:] method to define the object that implements the OTAudioBus protocol. The audio device pushes captured audio samples to and fetches unrendered audio samples from the audio bus.
The object that implements this protocol must invoke the [OTAudioBus writeCaptureData:numberOfSamples:] and [OTAudioBus readRenderData:numberOfSamples:] methods to provide audio capture and render sample buffers.
Methods
| Name | Description |
|---|---|
writeCaptureData:numberOfSamples:(data, count) |
Passes audio data to transmit to a session. |
readRenderData:numberOfSamples:(data, count) → {uint32_t} |
Retrieves unrendered audio samples from the session. |
writeCaptureData:numberOfSamples:(data, count)
Passes audio data to transmit to a session.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
void * | A pointer to an audio buffer. |
count |
uint32_t | The number of samples available for copying. |
readRenderData:numberOfSamples:(data, count) → {uint32_t}
Retrieves unrendered audio samples from the session. This is most commonly used to send audio to the speakers, but is also an entry point for further audio processing.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
void * | A pointer to an audio buffer. |
count |
uint32_t | The number of samples requested. |
Returns:
uint32_t The number of samples copied out of the audio buffer.