ECRobot C++ API for LEGO MINDSTORMS NXT  1.0.10
ecrobot::Speaker Class Reference

NXT speaker class. More...

#include <Speaker.h>

List of all members.

Public Member Functions

 Speaker (void)
 Constructor.
void playTone (U32 freq, U32 duration, U32 volume)
 Play a tone sound.
S16 playWav (const CHAR *file, U32 length, U32 volume)
 Play an 8bit monochrome PCM WAV file.

Static Public Attributes

static const U32 MIN_TONE_FREQ = 33
 Minimum frequency of tone.
static const U32 MAX_TONE_FREQ = 1976
 Maximum frequency of tone.

Detailed Description

NXT speaker class.


Constructor & Destructor Documentation

Constructor.

Parameters:
-
Returns:
-

Member Function Documentation

void ecrobot::Speaker::playTone ( U32  freq,
U32  duration,
U32  volume 
)

Play a tone sound.

Parameters:
freqTone frequency in Hz. MIN_TONE_FREQ to MAX_TONE_FREQ
durationTone duration in msec (10msec unit)
volumeTone volume (0 to 100)
Returns:
-
S16 ecrobot::Speaker::playWav ( const CHAR *  file,
U32  length,
U32  volume 
)

Play an 8bit monochrome PCM WAV file.

Parameters:
fileHead of a WAV file
lengthLength of a WAV file
volumeVolume of WAV file (0 to 100)
Returns:
1:succeeded/0:sound resource was busy/-1:unsupported file format

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations Enumerator Friends Defines