Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
 All Classes Files Functions Variables Typedefs Macros Groups
Public Attributes | List of all members
InternalBelaContext Struct Reference

#include <PRU.h>

Public Attributes

float * audioIn
 Buffer holding audio input samples. More...
 
float * audioOut
 Buffer holding audio output samples. More...
 
float * analogIn
 Buffer holding analog input samples. More...
 
float * analogOut
 Buffer holding analog output samples. More...
 
uint32_t * digital
 Buffer holding digital input/output samples. More...
 
uint32_t audioFrames
 Number of audio frames per period.
 
uint32_t audioInChannels
 Number of input audio channels.
 
uint32_t audioOutChannels
 Number of output audio channels.
 
float audioSampleRate
 Audio sample rate in Hz (currently always 44100.0)
 
uint32_t analogFrames
 Number of analog frames per period. More...
 
uint32_t analogInChannels
 Number of input analog channels. More...
 
uint32_t analogOutChannels
 Number of output analog channels. More...
 
float analogSampleRate
 Analog sample rate in Hz. More...
 
uint32_t digitalFrames
 Number of digital frames per period.
 
uint32_t digitalChannels
 Number of digital channels. More...
 
float digitalSampleRate
 Digital sample rate in Hz (currently always 44100.0)
 
uint64_t audioFramesElapsed
 Number of elapsed audio frames since the start of rendering. More...
 
uint32_t multiplexerChannels
 Number of multiplexer channels for each analog input. More...
 
uint32_t multiplexerStartingChannel
 Multiplexer channel corresponding to the first analog frame. More...
 
float * multiplexerAnalogIn
 Buffer which holds multiplexed analog inputs, when multiplexer capelet is enabled. More...
 
uint32_t audioExpanderEnabled
 Flags for whether audio expander is enabled on given analog channels. More...
 
uint32_t flags
 Other audio/sensor settings. More...
 

Detailed Description

Internal version of the BelaContext struct which does not have const elements, so it can be modified by the code. When it's passed to the user code, it is typecast to the standard BelaContext.

Important: make sure this retains the same structure as BelaContext!

Member Data Documentation

float* InternalBelaContext::audioIn

Buffer holding audio input samples.

This buffer may be in either interleaved or non-interleaved format, depending on the contents of the BelaInitSettings structure. Note: this element is available in render() only.

float* InternalBelaContext::audioOut

Buffer holding audio output samples.

This buffer may be in either interleaved or non-interleaved format, depending on the contents of the BelaInitSettings structure. Note: this element is available in render() only.

float* InternalBelaContext::analogIn

Buffer holding analog input samples.

This buffer may be in either interleaved or non-interleaved format, depending on the contents of the BelaInitSettings structure. Note: this element is available in render() only.

float* InternalBelaContext::analogOut

Buffer holding analog output samples.

This buffer may be in either interleaved or non-interleaved format, depending on the contents of the BelaInitSettings structure. Note: this element is available in render() only.

uint32_t* InternalBelaContext::digital

Buffer holding digital input/output samples.

Note: this element is available in render() only.

uint32_t InternalBelaContext::analogFrames

Number of analog frames per period.

This will be 0 if analog I/O is disabled.

uint32_t InternalBelaContext::analogInChannels

Number of input analog channels.

This will be 0 if analog I/O is disabled.

uint32_t InternalBelaContext::analogOutChannels

Number of output analog channels.

This will be 0 if analog I/O is disabled.

float InternalBelaContext::analogSampleRate

Analog sample rate in Hz.

The analog sample rate depends on the number of analog channels used. If 8 channels are used, the sample rate is 22050. If 4 channels are used, the sample rate is 44100. If 2 channels are used, the sample rate is 88200. If analog I/O is disabled, the sample rate is 0.

uint32_t InternalBelaContext::digitalChannels

Number of digital channels.

Currently this will always be 16, unless digital I/O is disabled, in which case it will be 0.

uint64_t InternalBelaContext::audioFramesElapsed

Number of elapsed audio frames since the start of rendering.

This holds the total number of audio frames as of the beginning of the current period. To find the current number of analog or digital frames elapsed, multiply by the ratio of the sample rates (e.g. half the number of analog frames will have elapsed if the analog sample rate is 22050).

uint32_t InternalBelaContext::multiplexerChannels

Number of multiplexer channels for each analog input.

This will be 2, 4 or 8 if the multiplexer capelet is enabled, otherwise it will be 1. 2, 4 and 8 correspond to 16, 32 and 64 analog inputs, respectively.

uint32_t InternalBelaContext::multiplexerStartingChannel

Multiplexer channel corresponding to the first analog frame.

This indicates the multiplexer setting corresponding to the first analog frame in the buffer.

float* InternalBelaContext::multiplexerAnalogIn

Buffer which holds multiplexed analog inputs, when multiplexer capelet is enabled.

Because the analog in buffer size may be smaller than a complete cycle of the multiplexer capelet, this buffer will always be big enough to hold at least one complete cycle of all channels. It will be null if the multiplexer capelet is not enabled.

uint32_t InternalBelaContext::audioExpanderEnabled

Flags for whether audio expander is enabled on given analog channels.

Bits 0-15, when set, indicate audio expander enabled on the analog inputs. Bits 16-31 indicate audio expander enabled on the analog outputs.

uint32_t InternalBelaContext::flags

Other audio/sensor settings.

Binary combination of flags including:

BELA_FLAG_INTERLEAVED: indicates the audio and analog buffers are interleaved

BELA_FLAG_ANALOG_OUTPUTS_PERSIST: indicates that writes to the analog outputs will persist for future frames. If not set, writes affect one frame only.


The documentation for this struct was generated from the following file: