Streaming Library Demo

Location

$CAFE_ROOT/system/src/demo/ax/streamlib

Description

Demonstrates how to achieve streaming ADPCM voices. Files with and without looping in them are handled. Handling ADPCM streams that have loop points in the file is complex. To facilitate a game developers need to handle streaming, a thin layer on top of AX is written and delivered in AXStreamServer.c.

Console Output

After the program is invoked, it will display the following output:

axstream3.c built 18:24:45 Apr  6 2012
********************************************************
********************************************************
*            Streaming Library demo                    *
********************************************************
********************************************************
*    PAD Buttons are:                                  *
*    Home        Quit Program                          *
*    A           Loop voice control                    *
*    B           Start/Stop playing file               *
*    X           Change the renderer                   *
*    Y           Change the file to be played          *
********************************************************
********************************************************

Each time a stream is played the following output will be displayed:

Preparing Streams 
Starting Playback : axdemo/stream/sine_200Hz.dsp

TV Output


                streamUI.c built 18:05:13 Apr 6 2012
        Home  - Quit
           A  - Looping:  Off
           B  - Playback: Off                        
           X  - Renderer: DSP
           Y  - File:     sine_200Hz.dsp

    
                State:        STREAM_NONE
                File:        ONESHOT
             

The top portion of the display shows the controls. User can choose to enable or disable looping playback, playback, renderer and the file to be played. The bottom portion shows the state of the stream and whether the file is ONESHOT or LOOPED.

Navigating with the GamePad

Files

$CAFE_ROOT/system/src/demo/ax/streamlib/streamdemo.h Header file that defines STRMInfo structure used in the application. Users can change the structure to their needs.
$CAFE_ROOT/system/src/demo/ax/streamlib/streamDVD.h Header file that defines structures to handle the file read operations. Users can modify the file to their needs.
$CAFE_ROOT/system/src/demo/ax/streamlib/streamUI.h Header file that defines structures to handle the UI portion of the demo. Users can modify the file to their needs.
$CAFE_ROOT/system/src/demo/ax/streamlib/streamPool.h Header file that defines helper functions useful for buffer handling. Users can modify the file to their needs.
$CAFE_ROOT/system/src/demo/ax/streamlib/AXStream.h Header file that defines client and server states, API functions provided by Stream library.
$CAFE_ROOT/system/src/demo/ax/streamlib/AXStream.c Source file that implements the stream library.
$CAFE_ROOT/system/src/demo/ax/streamlib/streamDVD.c Source file that implements handling the file read operations.
$CAFE_ROOT/system/src/demo/ax/streamlib/streamUI.c Source file that implements handling the UI portion of the demo.
$CAFE_ROOT/system/src/demo/ax/streamlib/streamPool.c Source file that implements helper functions useful for buffer handling.
$CAFE_ROOT/data/disc/content/axdemo/stream/sine_200Hz.dsp One shot 200Hz sine waveform recorded at 32kHz.
$CAFE_ROOT/data/disc/content/axdemo/stream/sine_200Hz_8000_15999.dsp Looped 200Hz sine waveform recorded at 32kHz with loop points at 8001 and 16000 sample.
$CAFE_ROOT/data/disc/content/axdemo/stream/sine_200Hz_0_15999.dsp Looped 200Hz sine waveform recorded at 32kHz with loop points at 1 and 16000 sample.
$CAFE_ROOT/data/disc/content/axdemo/simple/stratch.dsp Looped damp E2 string.
$CAFE_ROOT/data/disc/content/axdemo/simple/strat.dsp Looped open E2 string.

Samples

STRATCH Looped damped E2 string.
STRAT Looped open E2 string.
CHIMES Looped Chinese chimes.
FROGGIES Night-time Frog Chorus.
FOGHORN Puget Sound Ferry Foghorn.

See Also

AXAcquireVoice
AXSetVoiceState
SPGetSoundEntry
SPInitSoundTable
SPPrepareEnd
SPPrepareSound

Revision History

2013/05/08 Automated cleanup pass.
2012/01/26 Updated for SDK 2.02 Release


CONFIDENTIAL