FlightGear next
FGSoundGenerator Class Reference

#include <soundgenerator.hxx>

Inherited by FGBeacon, and FGMorse.

Public Member Functions

virtual ~FGSoundGenerator ()
 

Static Public Attributes

static const int BYTES_PER_SECOND = 22050
 
static const int BEAT_LENGTH = 92
 
static const int TRANSITION_BYTES = BYTES_PER_SECOND/200
 
static const int COUNT_SIZE = BYTES_PER_SECOND * BEAT_LENGTH / 1000
 
static const int DIT_SIZE = 2 * COUNT_SIZE
 
static const int DAH_SIZE = 4 * COUNT_SIZE
 
static const int SPACE_SIZE = 3 * COUNT_SIZE
 
static const int LO_FREQUENCY = 1020
 
static const int HI_FREQUENCY = 1350
 

Related Symbols

(Note that these are not member symbols.)

static void make_tone (unsigned char *buf, int freq, int len, int total_len, int trans_len)
 Make a tone of specified freq and total_len with trans_len ramp in and out and only the first len bytes with sound, the rest with silence.
 

Detailed Description

Definition at line 30 of file soundgenerator.hxx.

Constructor & Destructor Documentation

◆ ~FGSoundGenerator()

FGSoundGenerator::~FGSoundGenerator ( )
virtual

Definition at line 25 of file soundgenerator.cxx.

Friends And Related Symbol Documentation

◆ make_tone()

void FGSoundGenerator::make_tone ( unsigned char * buf,
int freq,
int len,
int total_len,
int trans_len )
related

Make a tone of specified freq and total_len with trans_len ramp in and out and only the first len bytes with sound, the rest with silence.

Parameters
bufunsigned char pointer to sound buffer
freqdesired frequency of tone
lenlength of tone within sound
total_lentotal length of sound (anything more than len is padded with silence.
trans_lenlength of ramp up and ramp down to avoid audio "pop"

Definition at line 32 of file soundgenerator.cxx.

Member Data Documentation

◆ BEAT_LENGTH

const int FGSoundGenerator::BEAT_LENGTH = 92
static

Definition at line 35 of file soundgenerator.hxx.

◆ BYTES_PER_SECOND

const int FGSoundGenerator::BYTES_PER_SECOND = 22050
static

Definition at line 33 of file soundgenerator.hxx.

◆ COUNT_SIZE

const int FGSoundGenerator::COUNT_SIZE = BYTES_PER_SECOND * BEAT_LENGTH / 1000
static

Definition at line 37 of file soundgenerator.hxx.

◆ DAH_SIZE

const int FGSoundGenerator::DAH_SIZE = 4 * COUNT_SIZE
static

Definition at line 39 of file soundgenerator.hxx.

◆ DIT_SIZE

const int FGSoundGenerator::DIT_SIZE = 2 * COUNT_SIZE
static

Definition at line 38 of file soundgenerator.hxx.

◆ HI_FREQUENCY

const int FGSoundGenerator::HI_FREQUENCY = 1350
static

Definition at line 42 of file soundgenerator.hxx.

◆ LO_FREQUENCY

const int FGSoundGenerator::LO_FREQUENCY = 1020
static

Definition at line 41 of file soundgenerator.hxx.

◆ SPACE_SIZE

const int FGSoundGenerator::SPACE_SIZE = 3 * COUNT_SIZE
static

Definition at line 40 of file soundgenerator.hxx.

◆ TRANSITION_BYTES

const int FGSoundGenerator::TRANSITION_BYTES = BYTES_PER_SECOND/200
static

Definition at line 36 of file soundgenerator.hxx.


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