Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Scroll Documents: Update page title prefix

Overview

Repetitively outputs a block of data as pulled by a downstream module

Discussion

This module has an internal circular buffer containing audio data and works in conjunction with some of the other modules which "pull data" in real-time. The module has an internal circular buffer which is initialized with a block of audio data. The module is then ready to output data.

...

The output of the module is a single integer which points to a data structure in memory. By manipulating the data structure, a downstream module can pull data out of the module's circular buffer. This module currently works with file-based decoders and also the raw_streaming_source_module.m.

Type Definition

Code Block
typedef struct _ModulePeriodicStreaming
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 transferBufferSize;                     // NOT USED. Size of the transfer buffer, in 32-bit words.
    INT32 circularBufferSize;                     // Size of the circular buffer, in 32-bit words.
    INT32 prefillLevel;                           // NOT USED. Circular buffer fills to this number of words before data is output.
    INT32 underflowCount;                         // Number of output samples that could not be serviced.
    INT32 currentFillLevel;                       // Number of available data samples in the circular buffer.
    INT32 isReady;                                // Boolean that indicates whether the module is ready to output data.
    INT32 isPrefilling;                           // Boolean that indicates whether the module is waiting for prefill data. While waiting, the module does not output data.
    INT32 asyncStatus;                            // Used to pass asynchronous messages (pause/stop/play) from the PC to the target.
    INT32 playbackState;                          // Indicates the current state of the player: FIOS_Stopped, FIOS_Playing, FIOS_Paused. Starts out in FIOS_Stopped.
    INT32 isNewStream;                            // Boolean that indicates whether the player has just output the first block of a new file.
    INT32 fileExtension;                          // First 4 letters of the file extension each packed as a byte into the word (for commonality with the file_streaming_module.m).
    INT32 writeIndex;                             // Index at which to write data into the circular buffer.
    INT32 readIndex;                              // Index at which to read data out of the circular buffer.
    INT32* transferBuffer;                        // NOT USED. Data transferred from PC to target DSP via this buffer.
    INT32* circularBuffer;                        // Data transferred from PC to target DSP via this buffer.
} ModulePeriodicStreamingClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

transferBufferSize

int

const

0

0

1:1000000

32-bit words

circularBufferSize

int

const

0

1024

1:1000000

32-bit words

prefillLevel

int

parameter

0

512

Unrestricted

32-bit words

underflowCount

int

state

0

0

Unrestricted

currentFillLevel

int

state

0

0

0:1024

32-bit words

isReady

int

state

0

1

0:1

isPrefilling

int

state

0

0

0:1

asyncStatus

int

state

0

0

Unrestricted

playbackState

int

state

0

7

Unrestricted

isNewStream

int

state

0

0

Unrestricted

fileExtension

int

state

0

0

Unrestricted

writeIndex

int

state

1

0

Unrestricted

readIndex

int

state

1

0

Unrestricted

transferBuffer

int*

parameter

0

[1 x 1]

Unrestricted

circularBuffer

int*

parameter

0

[1024 x 1]

Unrestricted

Pins

Output Pins

Name: ID

Description: Module objectID

Data type: int

MATLAB Usage

File Name: periodic_streaming_module.m

...