hx3d  1
2D/3D Simple Game Framework
Public Member Functions | List of all members
hx3d::audio::S16Converter Class Reference

Convert an audio stream to the signed short format. More...

#include <s16_converter.hpp>

Public Member Functions

virtual void onFunction (const int channel, const void *stream, const int length) override
 Audio effect function. More...
 
virtual void onDone (const int channel) override
 Audio effect done function. More...
 
short * getS16Stream ()
 Get the stream in signed short format. More...
 
- Public Member Functions inherited from hx3d::audio::Effect
int getChannel ()
 Get the audio channel related to the effect. More...
 
void * getStream ()
 Get the audio stream. More...
 
int getSampleSize ()
 Get the sample size. More...
 
bool hasProcessed ()
 Test if the effect has started.
 

Additional Inherited Members

- Protected Attributes inherited from hx3d::audio::Effect
bool _processed
 Has the effect started ?
 
int _channel
 Audio channel.
 
void * _stream
 Sound stream.
 
int _length
 Sound length.
 

Detailed Description

Convert an audio stream to the signed short format.

Example code

// Inside a create function...
// Converter creation
audio::S16Converter converter;
// Assign the converter as an effect over the main post channel
[...]
// Inside an update function...
// If the converter has finished to convert
if (converter.hasProcessed()) {
// Get the signed short stream and do whatever you want !
short* stream = converter.getS16Stream();
}

Definition at line 54 of file s16_converter.hpp.

Member Function Documentation

short * hx3d::audio::S16Converter::getS16Stream ( )

Get the stream in signed short format.

Returns
Signed short stream

Definition at line 54 of file s16_converter.cpp.

void hx3d::audio::S16Converter::onDone ( const int  channel)
overridevirtual

Audio effect done function.

See also
AudioDevice::registerEffect
Parameters
channelAudio channel

Reimplemented from hx3d::audio::Effect.

Definition at line 51 of file s16_converter.cpp.

void hx3d::audio::S16Converter::onFunction ( const int  channel,
const void *  stream,
const int  length 
)
overridevirtual

Audio effect function.

See also
AudioDevice::registerEffect
Parameters
channelAudio channel
streamAudio stream
lengthSample length

Reimplemented from hx3d::audio::Effect.

Definition at line 29 of file s16_converter.cpp.


The documentation for this class was generated from the following files: