}
int
- AudioSink::poll_fds(struct pollfd * array, int space)
+ AudioSink::poll_fds(struct pollfd *, int)
{
return 0;
}
}
int
- BlankPanel::poll_fds(struct pollfd * array, int space)
+ BlankPanel::poll_fds(struct pollfd *, int)
{
return 0;
}
/// drivers.
const unsigned int SampleRate = 48000;
+/// The number of audio samples per millisecond, at SampleRate.
+const unsigned int SamplesPerMillisecond = ((double)SampleRate / 1000.0);
+
// The audio frame duration in milliseconds. The audio interfaces will
// use this as a period size. It should be 1/2 of the smallest codec frame
// size we expect to use.
const unsigned int AudioFrameDuration = 10;
+/// The number of audio samples in an audio frame.
+const unsigned int AudioFrameSamples = SamplesPerMillisecond
+ * AudioFrameDuration;
+
/// Allocate memory and copy a string into it, so that it is permanently
/// stored.
/// \param s The string to be copied.
}
int
- PTTConstant::poll_fds(struct pollfd * array, int space)
+ PTTConstant::poll_fds(struct pollfd *, int)
{
return 0;
}
}
int
- TextConstant::poll_fds(struct pollfd * array, int space)
+ TextConstant::poll_fds(struct pollfd *, int)
{
return 0;
}
input++;
}
tones[index].frequency = 0.0;
- tones[index].amplitude = 0.0;
+ tones[index].amplitude = -1.0;
}
Tone::~Tone()
for ( unsigned int i = 0; i < length; i++ ) {
float value = 0;
float sumOfAmplitudes = 0;
- for ( unsigned int j = 0; j < array_length && tones[j].amplitude > 0.0;
+ for ( unsigned int j = 0; j < array_length && tones[j].amplitude >= 0.0;
j++ ) {
value += (sine_wave(tones[j].frequency, clock + i)
* tones[j].amplitude);
// FIX: Hoist this out of the inner loop after it's tested.
sumOfAmplitudes += tones[j].amplitude;
}
+ // FIX: Hoist this out of the inner loop after it's tested.
// If the sum of amplitudes is greater than 1.0, normalize so that the
// sum of amplitudes is 1.0.
if ( sumOfAmplitudes > 1.0 )
}
int
- Tone::poll_fds(struct pollfd * array, int space)
+ Tone::poll_fds(struct pollfd *, int)
{
return 0;
}