Add control properties to audiotestsrc

Add control properties to audiotestsrc for frequency and volume
and add a test program.
Add size parameter to set_io for additional checks and to make it
easy to know how much control data we can write.
This commit is contained in:
Wim Taymans 2017-11-22 14:30:04 +01:00
parent 8efea3e1ea
commit a092b9312a
28 changed files with 774 additions and 64 deletions

View file

@ -27,10 +27,12 @@ audio_test_src_create_sine_##type (struct impl *this, type *samples, size_t n_sa
{ \
int i, c, channels; \
double step, amp; \
double freq = *this->io_freq; \
double volume = *this->io_volume; \
\
channels = this->current_format.info.raw.channels; \
step = M_PI_M2 * this->props.freq / this->current_format.info.raw.rate; \
amp = this->props.volume * scale; \
step = M_PI_M2 * freq / this->current_format.info.raw.rate; \
amp = volume * scale; \
\
for (i = 0; i < n_samples; i++) { \
type val; \