From 4d36db10287e3f6e999b4479322f74b261f23f85 Mon Sep 17 00:00:00 2001 From: pschatzmann Date: Fri, 18 Oct 2024 07:45:39 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20doxygen=20from=20@=20pschatzma?= =?UTF-8?q?nn/arduino-audio-tools@2053bd622415c5d35b37b6ab016d095636806d14?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _codec_g_g_wave_8h_source.html | 2 +- _sound_generator_8h_source.html | 1041 +++++++++-------- annotated.html | 2 +- ...saudio__tools_1_1_fast_sine_generator.html | 5 +- classaudio__tools_1_1_fast_sine_generator.png | Bin 961 -> 1315 bytes ...saudio__tools_1_1_saw_tooth_generator.html | 6 +- ...saudio__tools_1_1_sine_wave_generator.html | 6 +- classaudio__tools_1_1_sine_wave_generator.png | Bin 2034 -> 2270 bytes ...ols_1_1_square_wave_generator-members.html | 34 +- ...udio__tools_1_1_square_wave_generator.html | 5 + ...audio__tools_1_1_square_wave_generator.png | Bin 1000 -> 1307 bytes group__generator.html | 2 +- hierarchy.html | 6 +- namespaceaudio__tools.html | 2 +- namespaces.html | 2 +- search/all_12.js | 2 +- search/functions_11.js | 2 +- 17 files changed, 563 insertions(+), 554 deletions(-) diff --git a/_codec_g_g_wave_8h_source.html b/_codec_g_g_wave_8h_source.html index 3f03b167e6..4afb929d60 100644 --- a/_codec_g_g_wave_8h_source.html +++ b/_codec_g_g_wave_8h_source.html @@ -368,7 +368,7 @@
Docoding of encoded audio into PCM data.
Definition: AudioCodecsBase.h:16
Encoding of PCM data.
Definition: AudioCodecsBase.h:86
-
virtual T readSample() override
Provides a single sample.
Definition: SoundGenerator.h:265
+
virtual T readSample() override
Provides a single sample.
Definition: SoundGenerator.h:240
GGWaveDecoder: Translates audio into text Codec using https://github.com/ggerganov/ggwave-arduino.
Definition: CodecGGWave.h:36
void setProtocols(ggwave_ProtocolId protocolsArray[N])
Activate multiple protocols.
Definition: CodecGGWave.h:53
virtual bool isResultPCM()
Returns true to indicate that the decoding result is PCM data.
Definition: CodecGGWave.h:138
diff --git a/_sound_generator_8h_source.html b/_sound_generator_8h_source.html index 3d2ab5b0cb..e08ce72d19 100644 --- a/_sound_generator_8h_source.html +++ b/_sound_generator_8h_source.html @@ -258,524 +258,525 @@
222  }
223 };
224 
-
232 template <class T> class SquareWaveGenerator : public SineWaveGenerator<T> {
-
233 public:
-
234  SquareWaveGenerator(float amplitude = 32767.0f, float phase = 0.0f)
-
235  : SineWaveGenerator<T>(amplitude, phase) {
-
236  LOGD("SquareWaveGenerator");
-
237  }
-
238 
-
239  virtual T readSample() {
-
240  return value(SineWaveGenerator<T>::readSample(),
-
241  SineWaveGenerator<T>::m_amplitude);
-
242  }
-
243 
-
244 protected:
-
245  // returns amplitude for positive vales and -amplitude for negative values
-
246  T value(T value, T amplitude) {
-
247  return (value >= 0) ? amplitude : -amplitude;
-
248  }
-
249 };
-
250 
-
258 template <class T> class FastSineGenerator : public SineWaveGenerator<T> {
-
259 public:
-
260  FastSineGenerator(float amplitude = 32767.0, float phase = 0.0)
-
261  : SineWaveGenerator<T>(amplitude, phase) {
-
262  LOGD("FastSineGenerator");
-
263  }
-
264 
-
265  virtual T readSample() override {
-
266  float angle =
-
267  SineWaveGenerator<T>::m_cycles + SineWaveGenerator<T>::m_phase;
-
268  T result = SineWaveGenerator<T>::m_amplitude * sine(angle);
-
269  SineWaveGenerator<T>::m_cycles +=
-
270  SineWaveGenerator<T>::m_frequency * SineWaveGenerator<T>::m_deltaTime;
-
271  if (SineWaveGenerator<T>::m_cycles > 1.0) {
-
272  SineWaveGenerator<T>::m_cycles -= 1.0;
-
273  }
-
274  return result;
-
275  }
-
276 
-
277 protected:
-
279  inline float sine(float t) {
-
280  float p = (t - (int)t) - 0.5f; // 0 <= p <= 1
-
281  float pp = p * p;
-
282  return (p - 6.283211f * pp * p + 9.132843f * pp * pp * p) * -6.221086f;
-
283  }
-
284 };
-
285 
+
225 
+
233 template <class T> class FastSineGenerator : public SineWaveGenerator<T> {
+
234 public:
+
235  FastSineGenerator(float amplitude = 32767.0, float phase = 0.0)
+
236  : SineWaveGenerator<T>(amplitude, phase) {
+
237  LOGD("FastSineGenerator");
+
238  }
+
239 
+
240  virtual T readSample() override {
+
241  float angle =
+
242  SineWaveGenerator<T>::m_cycles + SineWaveGenerator<T>::m_phase;
+
243  T result = SineWaveGenerator<T>::m_amplitude * sine(angle);
+
244  SineWaveGenerator<T>::m_cycles +=
+
245  SineWaveGenerator<T>::m_frequency * SineWaveGenerator<T>::m_deltaTime;
+
246  if (SineWaveGenerator<T>::m_cycles > 1.0) {
+
247  SineWaveGenerator<T>::m_cycles -= 1.0;
+
248  }
+
249  return result;
+
250  }
+
251 
+
252 protected:
+
254  inline float sine(float t) {
+
255  float p = (t - (int)t) - 0.5f; // 0 <= p <= 1
+
256  float pp = p * p;
+
257  return (p - 6.283211f * pp * p + 9.132843f * pp * pp * p) * -6.221086f;
+
258  }
+
259 };
+
260 
+
268 template <class T> class SquareWaveGenerator : public FastSineGenerator<T> {
+
269 public:
+
270  SquareWaveGenerator(float amplitude = 32767.0f, float phase = 0.0f)
+
271  : FastSineGenerator<T>(amplitude, phase) {
+
272  LOGD("SquareWaveGenerator");
+
273  }
+
274 
+
275  virtual T readSample() {
+
276  return value(FastSineGenerator<T>::readSample(),
+
277  FastSineGenerator<T>::m_amplitude);
+
278  }
+
279 
+
280 protected:
+
281  // returns amplitude for positive vales and -amplitude for negative values
+
282  T value(T value, T amplitude) {
+
283  return (value >= 0) ? amplitude : -amplitude;
+
284  }
+
285 };
286 
-
294 template <class T> class SawToothGenerator : public SineWaveGenerator<T> {
-
295 public:
-
296  SawToothGenerator(float amplitude = 32767.0, float phase = 0.0)
-
297  : SineWaveGenerator<T>(amplitude, phase) {
-
298  LOGD("SawToothGenerator");
-
299  }
-
300 
-
301  virtual T readSample() override {
-
302  float angle =
-
303  SineWaveGenerator<T>::m_cycles + SineWaveGenerator<T>::m_phase;
-
304  T result = SineWaveGenerator<T>::m_amplitude * saw(angle);
-
305  SineWaveGenerator<T>::m_cycles +=
-
306  SineWaveGenerator<T>::m_frequency * SineWaveGenerator<T>::m_deltaTime;
-
307  if (SineWaveGenerator<T>::m_cycles > 1.0) {
-
308  SineWaveGenerator<T>::m_cycles -= 1.0;
-
309  }
-
310  return result;
-
311  }
-
312 
-
313 protected:
-
315  inline float saw(float t) {
-
316  float p = (t - (int)t) - 0.5f; // 0 <= p <= 1
-
317  return p;
-
318  }
-
319 };
-
320 
-
328 template <class T> class WhiteNoiseGenerator : public SoundGenerator<T> {
-
329 public:
-
331  WhiteNoiseGenerator(T amplitude = 32767) { this->amplitude = amplitude; }
-
332 
-
334  T readSample() { return (random(-amplitude, amplitude)); }
-
335 
-
336 protected:
-
337  T amplitude;
-
338  // //range : [min, max]
-
339  int random(int min, int max) { return min + rand() % ((max + 1) - min); }
-
340 };
-
341 
-
349 template <class T> class PinkNoiseGenerator : public SoundGenerator<T> {
-
350 public:
-
352  PinkNoiseGenerator(T amplitude = 32767) {
-
353  this->amplitude = amplitude;
-
354  max_key = 0x1f; // Five bits set
-
355  key = 0;
-
356  for (int i = 0; i < 5; i++)
-
357  white_values[i] = rand() % (amplitude / 5);
-
358  }
-
359 
-
361  T readSample() {
-
362  T last_key = key;
-
363  unsigned int sum;
-
364 
-
365  key++;
-
366  if (key > max_key)
-
367  key = 0;
-
368  // Exclusive-Or previous value with current value. This gives
-
369  // a list of bits that have changed.
-
370  int diff = last_key ^ key;
-
371  sum = 0;
-
372  for (int i = 0; i < 5; i++) {
-
373  // If bit changed get new random number for corresponding
-
374  // white_value
-
375  if (diff & (1 << i))
-
376  white_values[i] = rand() % (amplitude / 5);
-
377  sum += white_values[i];
-
378  }
-
379  return sum;
-
380  }
-
381 
-
382 protected:
-
383  T max_key;
-
384  T key;
-
385  unsigned int white_values[5];
-
386  unsigned int amplitude;
-
387 };
-
388 
-
398 template <class T> class SilenceGenerator : public SoundGenerator<T> {
-
399 public:
-
400  // the scale defines the max value which is generated
-
401  SilenceGenerator(T value = 0) { this->value = value; }
-
402 
-
404  T readSample() {
-
405  return value; // return 0
-
406  }
-
407 
-
408 protected:
-
409  T value;
-
410 };
-
411 
-
419 template <class T> class GeneratorFromStream : public SoundGenerator<T>, public VolumeSupport {
-
420 public:
-
421  GeneratorFromStream() {
-
422  maxValue = NumberConverter::maxValue(sizeof(T) * 8);
-
423  };
-
424 
-
434  GeneratorFromStream(Stream &input, int channels = 1, float volume = 1.0) {
-
435  maxValue = NumberConverter::maxValue(sizeof(T) * 8);
-
436  setStream(input);
-
437  setVolume(volume);
-
438  setChannels(channels);
-
439  }
-
440 
-
442  void setStream(Stream &input) { this->p_stream = &input; }
-
443 
-
444  void setChannels(int channels) { this->channels = channels; }
-
445 
-
447  T readSample() {
-
448  T data = 0;
-
449  float total = 0;
-
450  if (p_stream != nullptr) {
-
451  for (int j = 0; j < channels; j++) {
-
452  p_stream->readBytes((uint8_t *)&data, sizeof(T));
-
453  total += data;
-
454  }
-
455  float avg = (total / channels) * volume();
-
456  if (avg > maxValue) {
-
457  data = maxValue;
-
458  } else if (avg < -maxValue) {
-
459  data = -maxValue;
-
460  } else {
-
461  data = avg;
-
462  }
-
463  }
-
464  return data;
-
465  }
-
466 
-
467 protected:
-
468  Stream *p_stream = nullptr;
-
469  int channels = 1;
-
470  float maxValue;
-
471 };
-
472 
-
482 template <class T> class GeneratorFromArray : public SoundGenerator<T> {
-
483 public:
-
484  GeneratorFromArray() = default;
-
497  template <size_t arrayLen>
-
498  GeneratorFromArray(T (&array)[arrayLen], int repeat = 0,
-
499  bool setInactiveAtEnd = false, size_t startIndex = 0) {
-
500  TRACED();
-
501  this->max_repeat = repeat;
-
502  this->inactive_at_end = setInactiveAtEnd;
-
503  this->sound_index = startIndex;
-
504  setArray(array, arrayLen);
-
505  }
-
506 
-
507  ~GeneratorFromArray() {
-
508  if (owns_data) {
-
509  delete[] table;
-
510  }
-
511  }
-
512 
-
513  template <int arrayLen> void setArray(T (&array)[arrayLen]) {
-
514  TRACED();
-
515  setArray(array, arrayLen);
-
516  }
-
517 
-
518  void setArray(T *array, size_t size) {
-
519  this->table_length = size;
-
520  this->table = array;
-
521  LOGI("table_length: %d", (int)size);
-
522  }
-
523 
-
524  virtual bool begin(AudioInfo info) override {
-
525  return SoundGenerator<T>::begin(info);
-
526  }
-
527 
-
529  bool begin() override {
-
530  TRACEI();
-
531  SoundGenerator<T>::begin();
-
532  sound_index = 0;
-
533  repeat_counter = 0;
-
534  is_running = true;
-
535  return true;
-
536  }
-
537 
-
539  T readSample() override {
-
540  // at end deactivate output
-
541  if (sound_index >= table_length) {
-
542  // LOGD("reset index - sound_index: %d, table_length:
-
543  // %d",sound_index,table_length);
-
544  sound_index = 0;
-
545  // deactivate when count has been used up
-
546  if (max_repeat >= 1 && ++repeat_counter >= max_repeat) {
-
547  LOGD("atEnd");
-
548  this->is_running = false;
-
549  if (inactive_at_end) {
-
550  this->active = false;
-
551  }
-
552  }
-
553  }
-
554 
-
555  // LOGD("index: %d - active: %d", sound_index, this->active);
-
556  T result = 0;
-
557  if (this->is_running) {
-
558  result = table[sound_index];
-
559  sound_index += index_increment;
-
560  }
-
561 
-
562  return result;
-
563  }
-
564 
-
565  // step size the sound index is incremented (default = 1)
-
566  void setIncrement(int inc) { index_increment = inc; }
-
567 
-
568  // Sets up a sine table - returns the effective frequency
-
569  int setupSine(int sampleRate, float reqFrequency, float amplitude = 1.0) {
-
570  int sample_count =
-
571  static_cast<float>(sampleRate) /
-
572  reqFrequency; // e.g. 44100 / 300hz = 147 samples per wave
-
573  float angle = 2.0 * PI / sample_count;
-
574  table = new T[sample_count];
-
575  for (int j = 0; j < sample_count; j++) {
-
576  table[j] = sinf(j * angle) * amplitude;
-
577  }
-
578  owns_data = true;
-
579  table_length = sample_count;
-
580  // calculate effective frequency
-
581  return sampleRate / sample_count;
-
582  }
-
583 
-
584  // Similar like is active to check if the array is still playing.
-
585  bool isRunning() { return is_running; }
-
586 
-
587 protected:
-
588  int sound_index = 0;
-
589  int max_repeat = 0;
-
590  int repeat_counter = 0;
-
591  bool inactive_at_end;
-
592  bool is_running = false;
-
593  bool owns_data = false;
-
594  T *table = nullptr;
-
595  size_t table_length = 0;
-
596  int index_increment = 1;
-
597 };
-
598 
-
606 template <class T> class GeneratorFixedValue : public SoundGenerator<T> {
-
607 public:
-
608  GeneratorFixedValue() = default;
-
609 
-
610  virtual bool begin(AudioInfo info) { return SoundGenerator<T>::begin(info); }
-
611 
-
612  void setValue(T value) { value_set = value; }
-
613 
-
615  bool begin() override {
-
616  TRACEI();
-
617  SoundGenerator<T>::begin();
-
618  is_running = true;
-
619  value_return = value_set;
-
620  return true;
-
621  }
-
622 
-
624  T readSample() override { return value_return; }
-
625 
-
626  // Similar like is active to check if the array is still playing.
-
627  bool isRunning() { return is_running; }
-
628 
-
629 protected:
-
630  T value_set = 0;
-
631  T value_return = 0;
-
632  bool is_running = false;
-
633 };
-
634 
-
642 template <class T> class SineFromTable : public SoundGenerator<T> {
-
643 public:
-
644  SineFromTable(float amplitude = 32767.0) {
-
645  this->amplitude = amplitude;
-
646  this->amplitude_to_be = amplitude;
-
647  }
-
648 
-
650  void setAmplitude(float amplitude) { this->amplitude_to_be = amplitude; }
-
651 
-
654  void setMaxAmplitudeStep(float step) { max_amplitude_step = step; }
-
655 
-
656  T readSample() {
-
657  // update angle
-
658  angle += step;
-
659  if (angle >= 360.0f) {
-
660  while (angle >= 360.0f) {
-
661  angle -= 360.0f;
-
662  }
-
663  // update frequency at start of circle (near 0 degrees)
-
664  step = step_new;
-
665 
-
666  updateAmplitudeInSteps();
-
667  // amplitude = amplitude_to_be;
-
668  }
-
669  return interpolate(angle);
-
670  }
-
671 
-
672  bool begin() {
-
673  is_first = true;
-
674  SoundGenerator<T>::begin();
-
675  base_frequency = SoundGenerator<T>::audioInfo().sample_rate /
-
676  360.0f; // 122.5 hz (at 44100); 61 hz (at 22050)
-
677  return true;
-
678  }
-
679 
-
680  bool begin(AudioInfo info, float frequency) {
-
681  SoundGenerator<T>::begin(info);
-
682  base_frequency = SoundGenerator<T>::audioInfo().sample_rate /
-
683  360.0f; // 122.5 hz (at 44100); 61 hz (at 22050)
-
684  setFrequency(frequency);
-
685  return true;
-
686  }
-
687 
-
688  bool begin(int channels, int sample_rate, uint16_t frequency = 0) {
-
689  SoundGenerator<T>::info.channels = channels;
-
690  SoundGenerator<T>::info.sample_rate = sample_rate;
-
691  return begin(SoundGenerator<T>::info, frequency);
-
692  }
-
693 
-
694  void setFrequency(float freq) {
-
695  step_new = freq / base_frequency;
-
696  if (is_first) {
-
697  step = step_new;
-
698  is_first = false;
-
699  }
-
700  LOGD("step: %f", step_new);
-
701  }
-
702 
-
703 protected:
-
704  bool is_first = true;
-
705  float amplitude;
-
706  float amplitude_to_be;
-
707  float max_amplitude_step = 50.0f;
-
708  float base_frequency = 1.0f;
-
709  float step = 1.0f;
-
710  float step_new = 1.0f;
-
711  float angle = 0.0f;
-
712  // 122.5 hz (at 44100); 61 hz (at 22050)
-
713  const float values[181] = {
-
714  0, 0.0174524, 0.0348995, 0.052336, 0.0697565, 0.0871557,
-
715  0.104528, 0.121869, 0.139173, 0.156434, 0.173648, 0.190809,
-
716  0.207912, 0.224951, 0.241922, 0.258819, 0.275637, 0.292372,
-
717  0.309017, 0.325568, 0.34202, 0.358368, 0.374607, 0.390731,
-
718  0.406737, 0.422618, 0.438371, 0.45399, 0.469472, 0.48481,
-
719  0.5, 0.515038, 0.529919, 0.544639, 0.559193, 0.573576,
-
720  0.587785, 0.601815, 0.615661, 0.62932, 0.642788, 0.656059,
-
721  0.669131, 0.681998, 0.694658, 0.707107, 0.71934, 0.731354,
-
722  0.743145, 0.75471, 0.766044, 0.777146, 0.788011, 0.798636,
-
723  0.809017, 0.819152, 0.829038, 0.838671, 0.848048, 0.857167,
-
724  0.866025, 0.87462, 0.882948, 0.891007, 0.898794, 0.906308,
-
725  0.913545, 0.920505, 0.927184, 0.93358, 0.939693, 0.945519,
-
726  0.951057, 0.956305, 0.961262, 0.965926, 0.970296, 0.97437,
-
727  0.978148, 0.981627, 0.984808, 0.987688, 0.990268, 0.992546,
-
728  0.994522, 0.996195, 0.997564, 0.99863, 0.999391, 0.999848,
-
729  1, 0.999848, 0.999391, 0.99863, 0.997564, 0.996195,
-
730  0.994522, 0.992546, 0.990268, 0.987688, 0.984808, 0.981627,
-
731  0.978148, 0.97437, 0.970296, 0.965926, 0.961262, 0.956305,
-
732  0.951057, 0.945519, 0.939693, 0.93358, 0.927184, 0.920505,
-
733  0.913545, 0.906308, 0.898794, 0.891007, 0.882948, 0.87462,
-
734  0.866025, 0.857167, 0.848048, 0.838671, 0.829038, 0.819152,
-
735  0.809017, 0.798636, 0.788011, 0.777146, 0.766044, 0.75471,
-
736  0.743145, 0.731354, 0.71934, 0.707107, 0.694658, 0.681998,
-
737  0.669131, 0.656059, 0.642788, 0.62932, 0.615661, 0.601815,
-
738  0.587785, 0.573576, 0.559193, 0.544639, 0.529919, 0.515038,
-
739  0.5, 0.48481, 0.469472, 0.45399, 0.438371, 0.422618,
-
740  0.406737, 0.390731, 0.374607, 0.358368, 0.34202, 0.325568,
-
741  0.309017, 0.292372, 0.275637, 0.258819, 0.241922, 0.224951,
-
742  0.207912, 0.190809, 0.173648, 0.156434, 0.139173, 0.121869,
-
743  0.104528, 0.0871557, 0.0697565, 0.052336, 0.0348995, 0.0174524,
-
744  0};
-
745 
-
746  T interpolate(float angle) {
-
747  bool positive = (angle <= 180.0f);
-
748  float angle_positive = positive ? angle : angle - 180.0f;
-
749  int angle_int1 = angle_positive;
-
750  int angle_int2 = angle_int1 + 1;
-
751  T v1 = values[angle_int1] * amplitude;
-
752  T v2 = values[angle_int2] * amplitude;
-
753  T result = v1 < v2 ? map(angle_positive, angle_int1, angle_int2, v1, v2)
-
754  : map(angle_positive, angle_int1, angle_int2, v2, v1);
-
755  // float result = v1;
-
756  return positive ? result : -result;
-
757  }
-
758 
-
759  T map(T x, T in_min, T in_max, T out_min, T out_max) {
-
760  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
-
761  }
-
762 
-
763  void updateAmplitudeInSteps() {
-
764  float diff = amplitude_to_be - amplitude;
-
765  if (abs(diff) > max_amplitude_step) {
-
766  diff = (diff < 0) ? -max_amplitude_step : max_amplitude_step;
-
767  }
-
768  if (abs(diff) >= 1.0f) {
-
769  amplitude += diff;
-
770  }
-
771  }
-
772 };
-
773 
-
781 template <class T> class GeneratorMixer : public SoundGenerator<T> {
-
782 public:
-
783  GeneratorMixer() = default;
-
784 
-
785  void add(SoundGenerator<T> &generator) { vector.push_back(&generator); }
-
786  void add(SoundGenerator<T> *generator) { vector.push_back(generator); }
-
787 
-
788  void clear() { vector.clear(); }
-
789 
-
790  T readSample() {
-
791  float total = 0.0f;
-
792  float count = 0.0f;
-
793  for (auto &generator : vector) {
-
794  if (generator->isActive()){
-
795  T sample = generator->readSample();
-
796  total += sample;
-
797  count += 1.0f;
-
798  }
-
799  }
-
800  return count > 0.0f ? total / count : 0;
-
801  }
-
802 
-
803 protected:
-
804  Vector<SoundGenerator<T> *> vector;
-
805  int actualChannel = 0;
-
806 };
-
807 
-
816 template <class T> class TestGenerator : public SoundGenerator<T> {
-
817 public:
-
818  TestGenerator(T max = 1000, T inc = 1) { this->max = max; }
-
819 
-
820  T readSample() override {
-
821  value += inc;
-
822  if (abs(value) >= max) {
-
823  inc = -inc;
-
824  value += (inc * 2);
-
825  }
-
826  return value;
-
827  }
-
828 
-
829 protected:
-
830  T max;
-
831  T value = 0;
-
832  T inc = 1;
-
833 };
-
834 
-
835 } // namespace audio_tools
+
287 
+
295 template <class T> class SawToothGenerator : public SineWaveGenerator<T> {
+
296 public:
+
297  SawToothGenerator(float amplitude = 32767.0, float phase = 0.0)
+
298  : SineWaveGenerator<T>(amplitude, phase) {
+
299  LOGD("SawToothGenerator");
+
300  }
+
301 
+
302  virtual T readSample() override {
+
303  float angle =
+
304  SineWaveGenerator<T>::m_cycles + SineWaveGenerator<T>::m_phase;
+
305  T result = SineWaveGenerator<T>::m_amplitude * saw(angle);
+
306  SineWaveGenerator<T>::m_cycles +=
+
307  SineWaveGenerator<T>::m_frequency * SineWaveGenerator<T>::m_deltaTime;
+
308  if (SineWaveGenerator<T>::m_cycles > 1.0) {
+
309  SineWaveGenerator<T>::m_cycles -= 1.0;
+
310  }
+
311  return result;
+
312  }
+
313 
+
314 protected:
+
316  inline float saw(float t) {
+
317  float p = (t - (int)t) - 0.5f; // 0 <= p <= 1
+
318  return p;
+
319  }
+
320 };
+
321 
+
329 template <class T> class WhiteNoiseGenerator : public SoundGenerator<T> {
+
330 public:
+
332  WhiteNoiseGenerator(T amplitude = 32767) { this->amplitude = amplitude; }
+
333 
+
335  T readSample() { return (random(-amplitude, amplitude)); }
+
336 
+
337 protected:
+
338  T amplitude;
+
339  // //range : [min, max]
+
340  int random(int min, int max) { return min + rand() % ((max + 1) - min); }
+
341 };
+
342 
+
350 template <class T> class PinkNoiseGenerator : public SoundGenerator<T> {
+
351 public:
+
353  PinkNoiseGenerator(T amplitude = 32767) {
+
354  this->amplitude = amplitude;
+
355  max_key = 0x1f; // Five bits set
+
356  key = 0;
+
357  for (int i = 0; i < 5; i++)
+
358  white_values[i] = rand() % (amplitude / 5);
+
359  }
+
360 
+
362  T readSample() {
+
363  T last_key = key;
+
364  unsigned int sum;
+
365 
+
366  key++;
+
367  if (key > max_key)
+
368  key = 0;
+
369  // Exclusive-Or previous value with current value. This gives
+
370  // a list of bits that have changed.
+
371  int diff = last_key ^ key;
+
372  sum = 0;
+
373  for (int i = 0; i < 5; i++) {
+
374  // If bit changed get new random number for corresponding
+
375  // white_value
+
376  if (diff & (1 << i))
+
377  white_values[i] = rand() % (amplitude / 5);
+
378  sum += white_values[i];
+
379  }
+
380  return sum;
+
381  }
+
382 
+
383 protected:
+
384  T max_key;
+
385  T key;
+
386  unsigned int white_values[5];
+
387  unsigned int amplitude;
+
388 };
+
389 
+
399 template <class T> class SilenceGenerator : public SoundGenerator<T> {
+
400 public:
+
401  // the scale defines the max value which is generated
+
402  SilenceGenerator(T value = 0) { this->value = value; }
+
403 
+
405  T readSample() {
+
406  return value; // return 0
+
407  }
+
408 
+
409 protected:
+
410  T value;
+
411 };
+
412 
+
420 template <class T> class GeneratorFromStream : public SoundGenerator<T>, public VolumeSupport {
+
421 public:
+
422  GeneratorFromStream() {
+
423  maxValue = NumberConverter::maxValue(sizeof(T) * 8);
+
424  };
+
425 
+
435  GeneratorFromStream(Stream &input, int channels = 1, float volume = 1.0) {
+
436  maxValue = NumberConverter::maxValue(sizeof(T) * 8);
+
437  setStream(input);
+
438  setVolume(volume);
+
439  setChannels(channels);
+
440  }
+
441 
+
443  void setStream(Stream &input) { this->p_stream = &input; }
+
444 
+
445  void setChannels(int channels) { this->channels = channels; }
+
446 
+
448  T readSample() {
+
449  T data = 0;
+
450  float total = 0;
+
451  if (p_stream != nullptr) {
+
452  for (int j = 0; j < channels; j++) {
+
453  p_stream->readBytes((uint8_t *)&data, sizeof(T));
+
454  total += data;
+
455  }
+
456  float avg = (total / channels) * volume();
+
457  if (avg > maxValue) {
+
458  data = maxValue;
+
459  } else if (avg < -maxValue) {
+
460  data = -maxValue;
+
461  } else {
+
462  data = avg;
+
463  }
+
464  }
+
465  return data;
+
466  }
+
467 
+
468 protected:
+
469  Stream *p_stream = nullptr;
+
470  int channels = 1;
+
471  float maxValue;
+
472 };
+
473 
+
483 template <class T> class GeneratorFromArray : public SoundGenerator<T> {
+
484 public:
+
485  GeneratorFromArray() = default;
+
498  template <size_t arrayLen>
+
499  GeneratorFromArray(T (&array)[arrayLen], int repeat = 0,
+
500  bool setInactiveAtEnd = false, size_t startIndex = 0) {
+
501  TRACED();
+
502  this->max_repeat = repeat;
+
503  this->inactive_at_end = setInactiveAtEnd;
+
504  this->sound_index = startIndex;
+
505  setArray(array, arrayLen);
+
506  }
+
507 
+
508  ~GeneratorFromArray() {
+
509  if (owns_data) {
+
510  delete[] table;
+
511  }
+
512  }
+
513 
+
514  template <int arrayLen> void setArray(T (&array)[arrayLen]) {
+
515  TRACED();
+
516  setArray(array, arrayLen);
+
517  }
+
518 
+
519  void setArray(T *array, size_t size) {
+
520  this->table_length = size;
+
521  this->table = array;
+
522  LOGI("table_length: %d", (int)size);
+
523  }
+
524 
+
525  virtual bool begin(AudioInfo info) override {
+
526  return SoundGenerator<T>::begin(info);
+
527  }
+
528 
+
530  bool begin() override {
+
531  TRACEI();
+
532  SoundGenerator<T>::begin();
+
533  sound_index = 0;
+
534  repeat_counter = 0;
+
535  is_running = true;
+
536  return true;
+
537  }
+
538 
+
540  T readSample() override {
+
541  // at end deactivate output
+
542  if (sound_index >= table_length) {
+
543  // LOGD("reset index - sound_index: %d, table_length:
+
544  // %d",sound_index,table_length);
+
545  sound_index = 0;
+
546  // deactivate when count has been used up
+
547  if (max_repeat >= 1 && ++repeat_counter >= max_repeat) {
+
548  LOGD("atEnd");
+
549  this->is_running = false;
+
550  if (inactive_at_end) {
+
551  this->active = false;
+
552  }
+
553  }
+
554  }
+
555 
+
556  // LOGD("index: %d - active: %d", sound_index, this->active);
+
557  T result = 0;
+
558  if (this->is_running) {
+
559  result = table[sound_index];
+
560  sound_index += index_increment;
+
561  }
+
562 
+
563  return result;
+
564  }
+
565 
+
566  // step size the sound index is incremented (default = 1)
+
567  void setIncrement(int inc) { index_increment = inc; }
+
568 
+
569  // Sets up a sine table - returns the effective frequency
+
570  int setupSine(int sampleRate, float reqFrequency, float amplitude = 1.0) {
+
571  int sample_count =
+
572  static_cast<float>(sampleRate) /
+
573  reqFrequency; // e.g. 44100 / 300hz = 147 samples per wave
+
574  float angle = 2.0 * PI / sample_count;
+
575  table = new T[sample_count];
+
576  for (int j = 0; j < sample_count; j++) {
+
577  table[j] = sinf(j * angle) * amplitude;
+
578  }
+
579  owns_data = true;
+
580  table_length = sample_count;
+
581  // calculate effective frequency
+
582  return sampleRate / sample_count;
+
583  }
+
584 
+
585  // Similar like is active to check if the array is still playing.
+
586  bool isRunning() { return is_running; }
+
587 
+
588 protected:
+
589  int sound_index = 0;
+
590  int max_repeat = 0;
+
591  int repeat_counter = 0;
+
592  bool inactive_at_end;
+
593  bool is_running = false;
+
594  bool owns_data = false;
+
595  T *table = nullptr;
+
596  size_t table_length = 0;
+
597  int index_increment = 1;
+
598 };
+
599 
+
607 template <class T> class GeneratorFixedValue : public SoundGenerator<T> {
+
608 public:
+
609  GeneratorFixedValue() = default;
+
610 
+
611  virtual bool begin(AudioInfo info) { return SoundGenerator<T>::begin(info); }
+
612 
+
613  void setValue(T value) { value_set = value; }
+
614 
+
616  bool begin() override {
+
617  TRACEI();
+
618  SoundGenerator<T>::begin();
+
619  is_running = true;
+
620  value_return = value_set;
+
621  return true;
+
622  }
+
623 
+
625  T readSample() override { return value_return; }
+
626 
+
627  // Similar like is active to check if the array is still playing.
+
628  bool isRunning() { return is_running; }
+
629 
+
630 protected:
+
631  T value_set = 0;
+
632  T value_return = 0;
+
633  bool is_running = false;
+
634 };
+
635 
+
643 template <class T> class SineFromTable : public SoundGenerator<T> {
+
644 public:
+
645  SineFromTable(float amplitude = 32767.0) {
+
646  this->amplitude = amplitude;
+
647  this->amplitude_to_be = amplitude;
+
648  }
+
649 
+
651  void setAmplitude(float amplitude) { this->amplitude_to_be = amplitude; }
+
652 
+
655  void setMaxAmplitudeStep(float step) { max_amplitude_step = step; }
+
656 
+
657  T readSample() {
+
658  // update angle
+
659  angle += step;
+
660  if (angle >= 360.0f) {
+
661  while (angle >= 360.0f) {
+
662  angle -= 360.0f;
+
663  }
+
664  // update frequency at start of circle (near 0 degrees)
+
665  step = step_new;
+
666 
+
667  updateAmplitudeInSteps();
+
668  // amplitude = amplitude_to_be;
+
669  }
+
670  return interpolate(angle);
+
671  }
+
672 
+
673  bool begin() {
+
674  is_first = true;
+
675  SoundGenerator<T>::begin();
+
676  base_frequency = SoundGenerator<T>::audioInfo().sample_rate /
+
677  360.0f; // 122.5 hz (at 44100); 61 hz (at 22050)
+
678  return true;
+
679  }
+
680 
+
681  bool begin(AudioInfo info, float frequency) {
+
682  SoundGenerator<T>::begin(info);
+
683  base_frequency = SoundGenerator<T>::audioInfo().sample_rate /
+
684  360.0f; // 122.5 hz (at 44100); 61 hz (at 22050)
+
685  setFrequency(frequency);
+
686  return true;
+
687  }
+
688 
+
689  bool begin(int channels, int sample_rate, uint16_t frequency = 0) {
+
690  SoundGenerator<T>::info.channels = channels;
+
691  SoundGenerator<T>::info.sample_rate = sample_rate;
+
692  return begin(SoundGenerator<T>::info, frequency);
+
693  }
+
694 
+
695  void setFrequency(float freq) {
+
696  step_new = freq / base_frequency;
+
697  if (is_first) {
+
698  step = step_new;
+
699  is_first = false;
+
700  }
+
701  LOGD("step: %f", step_new);
+
702  }
+
703 
+
704 protected:
+
705  bool is_first = true;
+
706  float amplitude;
+
707  float amplitude_to_be;
+
708  float max_amplitude_step = 50.0f;
+
709  float base_frequency = 1.0f;
+
710  float step = 1.0f;
+
711  float step_new = 1.0f;
+
712  float angle = 0.0f;
+
713  // 122.5 hz (at 44100); 61 hz (at 22050)
+
714  const float values[181] = {
+
715  0, 0.0174524, 0.0348995, 0.052336, 0.0697565, 0.0871557,
+
716  0.104528, 0.121869, 0.139173, 0.156434, 0.173648, 0.190809,
+
717  0.207912, 0.224951, 0.241922, 0.258819, 0.275637, 0.292372,
+
718  0.309017, 0.325568, 0.34202, 0.358368, 0.374607, 0.390731,
+
719  0.406737, 0.422618, 0.438371, 0.45399, 0.469472, 0.48481,
+
720  0.5, 0.515038, 0.529919, 0.544639, 0.559193, 0.573576,
+
721  0.587785, 0.601815, 0.615661, 0.62932, 0.642788, 0.656059,
+
722  0.669131, 0.681998, 0.694658, 0.707107, 0.71934, 0.731354,
+
723  0.743145, 0.75471, 0.766044, 0.777146, 0.788011, 0.798636,
+
724  0.809017, 0.819152, 0.829038, 0.838671, 0.848048, 0.857167,
+
725  0.866025, 0.87462, 0.882948, 0.891007, 0.898794, 0.906308,
+
726  0.913545, 0.920505, 0.927184, 0.93358, 0.939693, 0.945519,
+
727  0.951057, 0.956305, 0.961262, 0.965926, 0.970296, 0.97437,
+
728  0.978148, 0.981627, 0.984808, 0.987688, 0.990268, 0.992546,
+
729  0.994522, 0.996195, 0.997564, 0.99863, 0.999391, 0.999848,
+
730  1, 0.999848, 0.999391, 0.99863, 0.997564, 0.996195,
+
731  0.994522, 0.992546, 0.990268, 0.987688, 0.984808, 0.981627,
+
732  0.978148, 0.97437, 0.970296, 0.965926, 0.961262, 0.956305,
+
733  0.951057, 0.945519, 0.939693, 0.93358, 0.927184, 0.920505,
+
734  0.913545, 0.906308, 0.898794, 0.891007, 0.882948, 0.87462,
+
735  0.866025, 0.857167, 0.848048, 0.838671, 0.829038, 0.819152,
+
736  0.809017, 0.798636, 0.788011, 0.777146, 0.766044, 0.75471,
+
737  0.743145, 0.731354, 0.71934, 0.707107, 0.694658, 0.681998,
+
738  0.669131, 0.656059, 0.642788, 0.62932, 0.615661, 0.601815,
+
739  0.587785, 0.573576, 0.559193, 0.544639, 0.529919, 0.515038,
+
740  0.5, 0.48481, 0.469472, 0.45399, 0.438371, 0.422618,
+
741  0.406737, 0.390731, 0.374607, 0.358368, 0.34202, 0.325568,
+
742  0.309017, 0.292372, 0.275637, 0.258819, 0.241922, 0.224951,
+
743  0.207912, 0.190809, 0.173648, 0.156434, 0.139173, 0.121869,
+
744  0.104528, 0.0871557, 0.0697565, 0.052336, 0.0348995, 0.0174524,
+
745  0};
+
746 
+
747  T interpolate(float angle) {
+
748  bool positive = (angle <= 180.0f);
+
749  float angle_positive = positive ? angle : angle - 180.0f;
+
750  int angle_int1 = angle_positive;
+
751  int angle_int2 = angle_int1 + 1;
+
752  T v1 = values[angle_int1] * amplitude;
+
753  T v2 = values[angle_int2] * amplitude;
+
754  T result = v1 < v2 ? map(angle_positive, angle_int1, angle_int2, v1, v2)
+
755  : map(angle_positive, angle_int1, angle_int2, v2, v1);
+
756  // float result = v1;
+
757  return positive ? result : -result;
+
758  }
+
759 
+
760  T map(T x, T in_min, T in_max, T out_min, T out_max) {
+
761  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
+
762  }
+
763 
+
764  void updateAmplitudeInSteps() {
+
765  float diff = amplitude_to_be - amplitude;
+
766  if (abs(diff) > max_amplitude_step) {
+
767  diff = (diff < 0) ? -max_amplitude_step : max_amplitude_step;
+
768  }
+
769  if (abs(diff) >= 1.0f) {
+
770  amplitude += diff;
+
771  }
+
772  }
+
773 };
+
774 
+
782 template <class T> class GeneratorMixer : public SoundGenerator<T> {
+
783 public:
+
784  GeneratorMixer() = default;
+
785 
+
786  void add(SoundGenerator<T> &generator) { vector.push_back(&generator); }
+
787  void add(SoundGenerator<T> *generator) { vector.push_back(generator); }
+
788 
+
789  void clear() { vector.clear(); }
+
790 
+
791  T readSample() {
+
792  float total = 0.0f;
+
793  float count = 0.0f;
+
794  for (auto &generator : vector) {
+
795  if (generator->isActive()){
+
796  T sample = generator->readSample();
+
797  total += sample;
+
798  count += 1.0f;
+
799  }
+
800  }
+
801  return count > 0.0f ? total / count : 0;
+
802  }
+
803 
+
804 protected:
+
805  Vector<SoundGenerator<T> *> vector;
+
806  int actualChannel = 0;
+
807 };
+
808 
+
817 template <class T> class TestGenerator : public SoundGenerator<T> {
+
818 public:
+
819  TestGenerator(T max = 1000, T inc = 1) { this->max = max; }
+
820 
+
821  T readSample() override {
+
822  value += inc;
+
823  if (abs(value) >= max) {
+
824  inc = -inc;
+
825  value += (inc * 2);
+
826  }
+
827  return value;
+
828  }
+
829 
+
830 protected:
+
831  T max;
+
832  T value = 0;
+
833  T inc = 1;
+
834 };
+
835 
+
836 } // namespace audio_tools
virtual int readArray(T data[], int len)
reads multiple values
Definition: Buffers.h:41
virtual int writeArray(const T data[], int len)
Fills the buffer data.
Definition: Buffers.h:65
-
Sine wave which is based on a fast approximation function.
Definition: SoundGenerator.h:258
-
float sine(float t)
sine approximation.
Definition: SoundGenerator.h:279
-
virtual T readSample() override
Provides a single sample.
Definition: SoundGenerator.h:265
-
Just returns a constant value.
Definition: SoundGenerator.h:606
-
T readSample() override
Provides a single sample.
Definition: SoundGenerator.h:624
-
bool begin() override
Starts the generation of samples.
Definition: SoundGenerator.h:615
-
We generate the samples from an array which is provided in the constructor.
Definition: SoundGenerator.h:482
-
GeneratorFromArray(T(&array)[arrayLen], int repeat=0, bool setInactiveAtEnd=false, size_t startIndex=0)
Construct a new Generator from an array.
Definition: SoundGenerator.h:498
-
T readSample() override
Provides a single sample.
Definition: SoundGenerator.h:539
-
bool begin() override
Starts the generation of samples.
Definition: SoundGenerator.h:529
-
An Adapter Class which lets you use any Stream as a Generator.
Definition: SoundGenerator.h:419
-
void setStream(Stream &input)
(Re-)Assigns a stream to the Adapter class
Definition: SoundGenerator.h:442
-
GeneratorFromStream(Stream &input, int channels=1, float volume=1.0)
Constructs a new Generator from a Stream object that can be used e.g. as input for AudioEffectss.
Definition: SoundGenerator.h:434
-
T readSample()
Provides a single sample from the stream.
Definition: SoundGenerator.h:447
-
Generator which combines (mixes) multiple sound generators into one output.
Definition: SoundGenerator.h:781
-
T readSample()
Provides a single sample.
Definition: SoundGenerator.h:790
+
Sine wave which is based on a fast approximation function.
Definition: SoundGenerator.h:233
+
float sine(float t)
sine approximation.
Definition: SoundGenerator.h:254
+
virtual T readSample() override
Provides a single sample.
Definition: SoundGenerator.h:240
+
Just returns a constant value.
Definition: SoundGenerator.h:607
+
T readSample() override
Provides a single sample.
Definition: SoundGenerator.h:625
+
bool begin() override
Starts the generation of samples.
Definition: SoundGenerator.h:616
+
We generate the samples from an array which is provided in the constructor.
Definition: SoundGenerator.h:483
+
GeneratorFromArray(T(&array)[arrayLen], int repeat=0, bool setInactiveAtEnd=false, size_t startIndex=0)
Construct a new Generator from an array.
Definition: SoundGenerator.h:499
+
T readSample() override
Provides a single sample.
Definition: SoundGenerator.h:540
+
bool begin() override
Starts the generation of samples.
Definition: SoundGenerator.h:530
+
An Adapter Class which lets you use any Stream as a Generator.
Definition: SoundGenerator.h:420
+
void setStream(Stream &input)
(Re-)Assigns a stream to the Adapter class
Definition: SoundGenerator.h:443
+
GeneratorFromStream(Stream &input, int channels=1, float volume=1.0)
Constructs a new Generator from a Stream object that can be used e.g. as input for AudioEffectss.
Definition: SoundGenerator.h:435
+
T readSample()
Provides a single sample from the stream.
Definition: SoundGenerator.h:448
+
Generator which combines (mixes) multiple sound generators into one output.
Definition: SoundGenerator.h:782
+
T readSample()
Provides a single sample.
Definition: SoundGenerator.h:791
static int64_t maxValue(int value_bits_per_sample)
provides the biggest number for the indicated number of bits
Definition: AudioTypes.h:325
-
Generates pink noise.
Definition: SoundGenerator.h:349
-
PinkNoiseGenerator(T amplitude=32767)
the amplitude defines the max value which is generated
Definition: SoundGenerator.h:352
-
T readSample()
Provides a single sample.
Definition: SoundGenerator.h:361
+
Generates pink noise.
Definition: SoundGenerator.h:350
+
PinkNoiseGenerator(T amplitude=32767)
the amplitude defines the max value which is generated
Definition: SoundGenerator.h:353
+
T readSample()
Provides a single sample.
Definition: SoundGenerator.h:362
-
Sine wave which is based on a fast approximation function.
Definition: SoundGenerator.h:294
-
virtual T readSample() override
Provides a single sample.
Definition: SoundGenerator.h:301
-
float saw(float t)
sine approximation.
Definition: SoundGenerator.h:315
-
Provides a fixed value (e.g. 0) as sound data. This can be used e.g. to test the output functionality...
Definition: SoundGenerator.h:398
-
T readSample()
Provides a single sample.
Definition: SoundGenerator.h:404
-
A sine generator based on a table. The table is created using degrees where one full wave is 360 degr...
Definition: SoundGenerator.h:642
-
void setFrequency(float freq)
Abstract method: not implemented! Just provides an error message...
Definition: SoundGenerator.h:694
-
void setAmplitude(float amplitude)
Defines the new amplitude (volume)
Definition: SoundGenerator.h:650
-
void setMaxAmplitudeStep(float step)
Definition: SoundGenerator.h:654
-
T readSample()
Provides a single sample.
Definition: SoundGenerator.h:656
+
SawToothGenerator.
Definition: SoundGenerator.h:295
+
virtual T readSample() override
Provides a single sample.
Definition: SoundGenerator.h:302
+
float saw(float t)
sine approximation.
Definition: SoundGenerator.h:316
+
Provides a fixed value (e.g. 0) as sound data. This can be used e.g. to test the output functionality...
Definition: SoundGenerator.h:399
+
T readSample()
Provides a single sample.
Definition: SoundGenerator.h:405
+
A sine generator based on a table. The table is created using degrees where one full wave is 360 degr...
Definition: SoundGenerator.h:643
+
void setFrequency(float freq)
Abstract method: not implemented! Just provides an error message...
Definition: SoundGenerator.h:695
+
void setAmplitude(float amplitude)
Defines the new amplitude (volume)
Definition: SoundGenerator.h:651
+
void setMaxAmplitudeStep(float step)
Definition: SoundGenerator.h:655
+
T readSample()
Provides a single sample.
Definition: SoundGenerator.h:657
Generates a Sound with the help of sin() function. If you plan to change the amplitude or frequency (...
Definition: SoundGenerator.h:138
void setFrequency(float frequency) override
Defines the frequency - after the processing has been started.
Definition: SoundGenerator.h:191
virtual T readSample() override
Provides a single sample.
Definition: SoundGenerator.h:198
@@ -790,18 +791,18 @@
virtual AudioInfo audioInfo()
Provides the AudioInfo.
Definition: SoundGenerator.h:87
virtual void end()
ends the processing
Definition: SoundGenerator.h:51
virtual AudioInfo defaultConfig()
Provides the default configuration.
Definition: SoundGenerator.h:75
-
Generates a square wave sound.
Definition: SoundGenerator.h:232
-
virtual T readSample()
Provides a single sample.
Definition: SoundGenerator.h:239
+
Generates a square wave sound.
Definition: SoundGenerator.h:268
+
virtual T readSample()
Provides a single sample.
Definition: SoundGenerator.h:275
Definition: NoArduino.h:125
-
Generates a test signal which is easy to check because the values are incremented or decremented by 1...
Definition: SoundGenerator.h:816
-
T readSample() override
Provides a single sample.
Definition: SoundGenerator.h:820
+
Generates a test signal which is easy to check because the values are incremented or decremented by 1...
Definition: SoundGenerator.h:817
+
T readSample() override
Provides a single sample.
Definition: SoundGenerator.h:821
Vector implementation which provides the most important methods as defined by std::vector....
Definition: Vector.h:21
Supports the setting and getting of the volume.
Definition: AudioTypes.h:205
virtual float volume()
provides the actual volume in the range of 0.0f to 1.0f
Definition: AudioTypes.h:208
virtual bool setVolume(float volume)
define the actual volume in the range of 0.0f to 1.0f
Definition: AudioTypes.h:210
-
Generates a random noise sound with the help of rand() function.
Definition: SoundGenerator.h:328
-
WhiteNoiseGenerator(T amplitude=32767)
the scale defines the max value which is generated
Definition: SoundGenerator.h:331
-
T readSample()
Provides a single sample.
Definition: SoundGenerator.h:334
+
Generates a random noise sound with the help of rand() function.
Definition: SoundGenerator.h:329
+
WhiteNoiseGenerator(T amplitude=32767)
the scale defines the max value which is generated
Definition: SoundGenerator.h:332
+
T readSample()
Provides a single sample.
Definition: SoundGenerator.h:335
Generic Implementation of sound input and output for desktop environments using portaudio.
Definition: AudioConfig.h:819
Basic Audio information which drives e.g. I2S.
Definition: AudioTypes.h:50
sample_rate_t sample_rate
Sample Rate: e.g 44100.
Definition: AudioTypes.h:53
diff --git a/annotated.html b/annotated.html index 66d77355d4..014215b96b 100644 --- a/annotated.html +++ b/annotated.html @@ -534,7 +534,7 @@  CRTSPPCMAudioInfoPCMInfo subclass which provides the audio information from the AudioInfo parameter  CRTSPSourceFromAudioStreamSimple Facade which can turn AudioStream into a IAudioSource. This way we can e.g. use an I2SStream as source to stream data Depends on the https://github.com/pschatzmann/Micro-RTSP-Audio/ library  CRTSPSourceStreamSimple Facade which can turn any Stream into a IAudioSource. This way we can e.g. use an I2SStream as source to stream data Depends on the https://github.com/pschatzmann/Micro-RTSP-Audio/ library - CSawToothGeneratorSine wave which is based on a fast approximation function + CSawToothGeneratorSawToothGenerator  CSBCDecoderDecoder for SBC. Depends on https://github.com/pschatzmann/arduino-libsbc. Inspired by sbcdec.c  CSBCEncoderEncoder for SBC - Depends on https://github.com/pschatzmann/arduino-libsbc. Inspired by sbcenc.c  CScaledParameterScales a dynamic parameter to the indicated range diff --git a/classaudio__tools_1_1_fast_sine_generator.html b/classaudio__tools_1_1_fast_sine_generator.html index 628545f9ac..f3570129ad 100644 --- a/classaudio__tools_1_1_fast_sine_generator.html +++ b/classaudio__tools_1_1_fast_sine_generator.html @@ -85,8 +85,9 @@
-SineWaveGenerator< T > -SoundGenerator< T > +SineWaveGenerator< T > +SoundGenerator< T > +SquareWaveGenerator< T >
diff --git a/classaudio__tools_1_1_fast_sine_generator.png b/classaudio__tools_1_1_fast_sine_generator.png index 61986f581dc35c4a828bf49e398aa97b69a157da..8f3f124463ac66117cd44d097285265f5550dac9 100644 GIT binary patch literal 1315 zcmeAS@N?(olHy`uVBq!ia0vp^Yk>Fw2Q!ddceCO&kdg@S332`Z|38rV;?396{zDUh zEHFNB-~emq9eE&^qa?^Lm;tB=1g@S6F=Aj~+2rZs7*fIbcJ9Nz&ssdJ>g+4u|39%^ z*K-4>=jQV4+U_S^!3P?Q8$RZHX{L$=s$}x1u2FH-NL1By3g2-0v$|(`6@T5VCu-i8 z9QFCX&xtt@Cgy2%G5gKqCFeJo%id{--G1-FwDj##+3V+T>0P(G;%w#C+xN4kUODwX z@%nqSQ&CsbvUdjOEe=hayM5cK!*OkgzcPPzuL`SFX}_9KwR&;U+u}R^Hy=zY`t7wh z@${a35}#RYbKI|dJy(!#v!Qx}ozyOMiTX|MH}qJJPrR8t_duO>+V(fw!|!U}WdDA` zbg}O8tCD)s9z{>NZ#qo+H$^CHlG2n7lSCG_OkKipmMz*#b25j51AjxLiSV1phJtT> zHuztw%vj!ZHitoAaSLllz#%3VjYLME9tJ_Lhz1T-9fuYnF$E`1Zh?g;(g9wYn>&;| zi^1W-sqHCfbwKa@{neA6oJzCd`J%1*GU&S8x;bAqyq~%FrF^1)xL48BqH|9l2yDA{ zx_J5PI_n$fF2x?bwtaQ{-K}^3g{@u^R>!itZqcr|ndP!ov8n49#J^38%3f{rMnQ&+ zKgU`ley{(+xkm)H$=y1cwfkJ8?9}YN7iCl5u)pJGS?<5B(eL%U-&?*`2!E5f zA&oN|7(wSZHLCm#g~v9?SF?DxO$kyHbZC%c*qotu<9M>tt(gh)*L=R<$2$8agMu4I zxZnx4#K>u>VjCIGzydOZW%oXt15?85P5HN(M=%sz__^fmUgkNO9NZUPXV%<4&$iy- z-GO_B1)RIzefgR{`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audio__tools_1_1_saw_tooth_generator.html b/classaudio__tools_1_1_saw_tooth_generator.html index 1108cac1a4..fa925b2f10 100644 --- a/classaudio__tools_1_1_saw_tooth_generator.html +++ b/classaudio__tools_1_1_saw_tooth_generator.html @@ -75,7 +75,7 @@
-

Sine wave which is based on a fast approximation function. +

SawToothGenerator. More...

#include <SoundGenerator.h>

@@ -194,8 +194,8 @@

template<class T>
class audio_tools::SawToothGenerator< T >

-

Sine wave which is based on a fast approximation function.

-
Author
Vivian Leigh Stewart
+

SawToothGenerator.

+
Author
Phil Schatzmann
Template Parameters
diff --git a/classaudio__tools_1_1_sine_wave_generator.html b/classaudio__tools_1_1_sine_wave_generator.html index ff921baa59..e74ddfb0af 100644 --- a/classaudio__tools_1_1_sine_wave_generator.html +++ b/classaudio__tools_1_1_sine_wave_generator.html @@ -85,11 +85,11 @@
-SoundGenerator< T > +SoundGenerator< T > FastSineGenerator< int16_t > FastSineGenerator< T > -SawToothGenerator< T > -SquareWaveGenerator< T > +SawToothGenerator< T > +SquareWaveGenerator< T >
diff --git a/classaudio__tools_1_1_sine_wave_generator.png b/classaudio__tools_1_1_sine_wave_generator.png index 13cb66c80efd99572cd7e6412402addd0b1781cb..3602cbba530e057e383da3fa3b106fc444872972 100644 GIT binary patch literal 2270 zcmb_ec~nzZ8b=n3B8pNr5zvBgss=`|fFO&C1(d~6o(01W8McHlp@3lvf`x`Ei&GK> z2?7Gc!-ORgWM5@zfFLL)?34*%C$h&Rq%Y&lnNFvt^N;tO_ulvJz29BF?{|N{i@)w< zE5HBfehCQ)d3!sX8xj(dFvxC^m4exA*gAZVG&lb>&Cq3s2q=_>`(A z3&UE7LaE6Oy5>EEPp$Ke;GGYtKb8`+=J2p2`HT@I3v9$8l@1|Ej__zX|654D<;raQDlha!5*Ysh>lRL*DiK9;WbAk7k`fg4P!e zt!xfkvE{{K6lR8S)|aza?-3hF`HyvIEoaBdh0csZSP%*ut(Uwiq9=9 z(6++H#~`nV~CU^icjwc7-%x1@`D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Sqefg3%wqMI%UXcO zOdkqMzx1OjtC$en;EMo&EztaKTr?E>ki(HLLmgZ6Z;lN{y+*c@pj+HPQ;VHh5Nye+ sA(^*pL!US;pwkg|QQN-VoUFwy28r+Qyjx|B{-81beu2LAfBX8}FOA*(3jhEB diff --git a/classaudio__tools_1_1_square_wave_generator-members.html b/classaudio__tools_1_1_square_wave_generator-members.html index c8a6cc105e..1bdd122dfa 100644 --- a/classaudio__tools_1_1_square_wave_generator-members.html +++ b/classaudio__tools_1_1_square_wave_generator-members.html @@ -82,22 +82,24 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/classaudio__tools_1_1_square_wave_generator.html b/classaudio__tools_1_1_square_wave_generator.html index 882081e6ec..f10a8096f0 100644 --- a/classaudio__tools_1_1_square_wave_generator.html +++ b/classaudio__tools_1_1_square_wave_generator.html @@ -85,6 +85,7 @@
+FastSineGenerator< T > SineWaveGenerator< T > SoundGenerator< T > @@ -152,6 +153,10 @@
+ + + diff --git a/classaudio__tools_1_1_square_wave_generator.png b/classaudio__tools_1_1_square_wave_generator.png index c5fe5f64aa375e944f072dd2a3c7f5ef56d5cce6..b41dddf7efdc9c5e4b41be1dd82ac142c6a313d7 100644 GIT binary patch delta 1153 zcmV-{1b+MI2b&6z7Ye`#0{{R3uGx6Yks&&N1gc3yK~#7F?VZt%^Q;afDO(94A-QT(kdcJ(i#d_N%By@N|J}}V7K>AlCJb|ej8*4OVUYu zgl9o+U^9y(U1;}x9rPXcVSop)W$6uVdv~)j_r^ihTUN1;+1u@}SS7Xc@37^&jWSn% zx!GD~mzy`Mn`f=9vaq-5aDTzyXg7-ve-t?nb- z1sP#KBWJ_E!d}jlWXkQBTjvxu*V}ugWxWIJU>T00_WRj;x3t?|u}W&?N3i7+Idow@ zbm|RNe+1)fGqSg~%EC_4VRFIhM%n7K3vDNVrm%U_E@t=hjMY$?_J})u4NSzE^Brtw zIsDy$80P-M9-jVuEYZ-j-Kz_BeZF?D4}XKT*>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gs)U}5zCnM}< z<jx({400 z{Sl12&C1@|8Vh@n4hI*k2Ff;{D6~i%!seiz?C$p&tD%1~{So)D8W@i?=R4TWvdwn~ zVwn32yUq0HV~K{59iCmV^YgW_-sT&u&4&H`{JqE?!x~208E)QH8l1rXAZOdL+1uWG zUoCcItOvDXOM_A+daI=Nd{+%5>8~naCCNhpD@h&-SV{8GY_KV%G>HHl^a7YgGr_)I z6Vc8D`(_56hjuF1sFQI4Fn`OkEVGCOU=9T=fQJGWz(Wo8bK3x}wXUfG*z2LA8xKcL zHrP+|;3c=PPaR#aIh?ex`Ll}gqx^jzL+%?{%Qo8LlecCUqo?+Fl#JJ~#b@?a0UC#) z+>M5&KZ3ILz|&xDjfFMF!Ca!z)-Qln4SoH#ePfY^kL&gst4UJRZ-1MHB^I{idF>9c zon@Qv&c`r!p31)AeC)vwqw00IUsYVfoI0{kZhEP#g&VFCW4 o0v5nS0Sn-vwKgxyvKP#ufAVccKfp5ZBme*a07*qoM6N<$g4o}#bN~PV diff --git a/group__generator.html b/group__generator.html index a8aff5939e..c048ad1690 100644 --- a/group__generator.html +++ b/group__generator.html @@ -92,7 +92,7 @@ - + diff --git a/hierarchy.html b/hierarchy.html index beecdefff7..1d8f96bf7b 100644 --- a/hierarchy.html +++ b/hierarchy.html @@ -699,9 +699,9 @@ - - - + + + diff --git a/namespaceaudio__tools.html b/namespaceaudio__tools.html index b30401631d..63c04a4fdf 100644 --- a/namespaceaudio__tools.html +++ b/namespaceaudio__tools.html @@ -1384,7 +1384,7 @@ - + diff --git a/namespaces.html b/namespaces.html index 59babaa830..39a82e9111 100644 --- a/namespaces.html +++ b/namespaces.html @@ -534,7 +534,7 @@ - + diff --git a/search/all_12.js b/search/all_12.js index 4282c7b768..e6715483e0 100644 --- a/search/all_12.js +++ b/search/all_12.js @@ -14,7 +14,7 @@ var searchData= ['readioheadstream_1027',['ReadioHeadStream',['../classaudio__tools_1_1_readio_head_stream.html',1,'audio_tools']]], ['readnoise_1028',['readNoise',['../classaudio__tools_1_1_modulation_base_class.html#a24467c32bf72ccc3b07345a03df7c1b2',1,'audio_tools::ModulationBaseClass']]], ['readprotocol_1029',['readProtocol',['../classaudio__tools_1_1_audio_sync_reader.html#a33d8a11b63e981b24fe6f4bb2f5898b3',1,'audio_tools::AudioSyncReader']]], - ['readsample_1030',['readSample',['../classaudio__tools_1_1_s_t_k_generator.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::STKGenerator::readSample()'],['../namespaceaudio__tools.html#a4ce58b1cf7c8f2758bd2f7ac29d8bd5d',1,'audio_tools::readSample()'],['../classaudio__tools_1_1_synthesizer.html#a3196b8713184e130cc528f812af295b9',1,'audio_tools::Synthesizer::readSample()'],['../classaudio__tools_1_1_default_synthesizer_channel.html#a4a3e93a68ae7b16f4c0e3c658d6f33b3',1,'audio_tools::DefaultSynthesizerChannel::readSample()'],['../classaudio__tools_1_1_abstract_synthesizer_channel.html#ae67870232b4db5acddcd0e80e0022621',1,'audio_tools::AbstractSynthesizerChannel::readSample()'],['../classaudio__tools_1_1_test_generator.html#a913c911a6aff6d8c9b3deb24469ea336',1,'audio_tools::TestGenerator::readSample()'],['../classaudio__tools_1_1_generator_mixer.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::GeneratorMixer::readSample()'],['../classaudio__tools_1_1_sine_from_table.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::SineFromTable::readSample()'],['../classaudio__tools_1_1_generator_fixed_value.html#a913c911a6aff6d8c9b3deb24469ea336',1,'audio_tools::GeneratorFixedValue::readSample()'],['../classaudio__tools_1_1_generator_from_array.html#a913c911a6aff6d8c9b3deb24469ea336',1,'audio_tools::GeneratorFromArray::readSample()'],['../classaudio__tools_1_1_generator_from_stream.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::GeneratorFromStream::readSample()'],['../classaudio__tools_1_1_silence_generator.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::SilenceGenerator::readSample()'],['../classaudio__tools_1_1_pink_noise_generator.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::PinkNoiseGenerator::readSample()'],['../classaudio__tools_1_1_white_noise_generator.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::WhiteNoiseGenerator::readSample()'],['../classaudio__tools_1_1_saw_tooth_generator.html#a45b168302ee30ce87241d8987e5f9adf',1,'audio_tools::SawToothGenerator::readSample()'],['../classaudio__tools_1_1_fast_sine_generator.html#a45b168302ee30ce87241d8987e5f9adf',1,'audio_tools::FastSineGenerator::readSample()'],['../classaudio__tools_1_1_square_wave_generator.html#a408eeda85d9e14954a97f2c80e130320',1,'audio_tools::SquareWaveGenerator::readSample()'],['../classaudio__tools_1_1_sine_wave_generator.html#a45b168302ee30ce87241d8987e5f9adf',1,'audio_tools::SineWaveGenerator::readSample()'],['../classaudio__tools_1_1_sound_generator.html#a1ff01a896ef633c0bdf60dbf1448c2db',1,'audio_tools::SoundGenerator::readSample()'],['../classaudio__tools_1_1_audio_effects.html#a02a8b1a055e1177e195db62f9529118f',1,'audio_tools::AudioEffects::readSample()'],['../classaudio__tools_1_1_sound_generator_modulation.html#a45b168302ee30ce87241d8987e5f9adf',1,'audio_tools::SoundGeneratorModulation::readSample()']]], + ['readsample_1030',['readSample',['../classaudio__tools_1_1_s_t_k_generator.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::STKGenerator::readSample()'],['../namespaceaudio__tools.html#a4ce58b1cf7c8f2758bd2f7ac29d8bd5d',1,'audio_tools::readSample()'],['../classaudio__tools_1_1_synthesizer.html#a3196b8713184e130cc528f812af295b9',1,'audio_tools::Synthesizer::readSample()'],['../classaudio__tools_1_1_default_synthesizer_channel.html#a4a3e93a68ae7b16f4c0e3c658d6f33b3',1,'audio_tools::DefaultSynthesizerChannel::readSample()'],['../classaudio__tools_1_1_abstract_synthesizer_channel.html#ae67870232b4db5acddcd0e80e0022621',1,'audio_tools::AbstractSynthesizerChannel::readSample()'],['../classaudio__tools_1_1_test_generator.html#a913c911a6aff6d8c9b3deb24469ea336',1,'audio_tools::TestGenerator::readSample()'],['../classaudio__tools_1_1_generator_mixer.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::GeneratorMixer::readSample()'],['../classaudio__tools_1_1_sine_from_table.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::SineFromTable::readSample()'],['../classaudio__tools_1_1_generator_fixed_value.html#a913c911a6aff6d8c9b3deb24469ea336',1,'audio_tools::GeneratorFixedValue::readSample()'],['../classaudio__tools_1_1_generator_from_array.html#a913c911a6aff6d8c9b3deb24469ea336',1,'audio_tools::GeneratorFromArray::readSample()'],['../classaudio__tools_1_1_generator_from_stream.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::GeneratorFromStream::readSample()'],['../classaudio__tools_1_1_silence_generator.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::SilenceGenerator::readSample()'],['../classaudio__tools_1_1_pink_noise_generator.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::PinkNoiseGenerator::readSample()'],['../classaudio__tools_1_1_white_noise_generator.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::WhiteNoiseGenerator::readSample()'],['../classaudio__tools_1_1_saw_tooth_generator.html#a45b168302ee30ce87241d8987e5f9adf',1,'audio_tools::SawToothGenerator::readSample()'],['../classaudio__tools_1_1_square_wave_generator.html#a408eeda85d9e14954a97f2c80e130320',1,'audio_tools::SquareWaveGenerator::readSample()'],['../classaudio__tools_1_1_fast_sine_generator.html#a45b168302ee30ce87241d8987e5f9adf',1,'audio_tools::FastSineGenerator::readSample()'],['../classaudio__tools_1_1_sine_wave_generator.html#a45b168302ee30ce87241d8987e5f9adf',1,'audio_tools::SineWaveGenerator::readSample()'],['../classaudio__tools_1_1_sound_generator.html#a1ff01a896ef633c0bdf60dbf1448c2db',1,'audio_tools::SoundGenerator::readSample()'],['../classaudio__tools_1_1_audio_effects.html#a02a8b1a055e1177e195db62f9529118f',1,'audio_tools::AudioEffects::readSample()'],['../classaudio__tools_1_1_sound_generator_modulation.html#a45b168302ee30ce87241d8987e5f9adf',1,'audio_tools::SoundGeneratorModulation::readSample()']]], ['readsamples_1031',['readSamples',['../namespaceaudio__tools.html#a05732a8617ebf1fc88e99fa12d8f5f85',1,'audio_tools']]], ['readsilence_1032',['readSilence',['../classaudio__tools_1_1_audio_stream.html#a36e26f40121eda38b0042dcba026ab82',1,'audio_tools::AudioStream']]], ['readstream_1033',['readStream',['../classaudio__tools_1_1_wav_i_m_a_decoder.html#ab754136602e0bb22ec2be26dedd9ff50',1,'audio_tools::WavIMADecoder']]], diff --git a/search/functions_11.js b/search/functions_11.js index e78c9f592e..42eb410e47 100644 --- a/search/functions_11.js +++ b/search/functions_11.js @@ -8,7 +8,7 @@ var searchData= ['readframes_2846',['readFrames',['../classaudio__tools_1_1_base_buffer.html#a9a1bfa2c5cba939eed47428794683f22',1,'audio_tools::BaseBuffer']]], ['readnoise_2847',['readNoise',['../classaudio__tools_1_1_modulation_base_class.html#a24467c32bf72ccc3b07345a03df7c1b2',1,'audio_tools::ModulationBaseClass']]], ['readprotocol_2848',['readProtocol',['../classaudio__tools_1_1_audio_sync_reader.html#a33d8a11b63e981b24fe6f4bb2f5898b3',1,'audio_tools::AudioSyncReader']]], - ['readsample_2849',['readSample',['../namespaceaudio__tools.html#a4ce58b1cf7c8f2758bd2f7ac29d8bd5d',1,'audio_tools::readSample()'],['../classaudio__tools_1_1_synthesizer.html#a3196b8713184e130cc528f812af295b9',1,'audio_tools::Synthesizer::readSample()'],['../classaudio__tools_1_1_default_synthesizer_channel.html#a4a3e93a68ae7b16f4c0e3c658d6f33b3',1,'audio_tools::DefaultSynthesizerChannel::readSample()'],['../classaudio__tools_1_1_abstract_synthesizer_channel.html#ae67870232b4db5acddcd0e80e0022621',1,'audio_tools::AbstractSynthesizerChannel::readSample()'],['../classaudio__tools_1_1_test_generator.html#a913c911a6aff6d8c9b3deb24469ea336',1,'audio_tools::TestGenerator::readSample()'],['../classaudio__tools_1_1_generator_mixer.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::GeneratorMixer::readSample()'],['../classaudio__tools_1_1_sine_from_table.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::SineFromTable::readSample()'],['../classaudio__tools_1_1_generator_fixed_value.html#a913c911a6aff6d8c9b3deb24469ea336',1,'audio_tools::GeneratorFixedValue::readSample()'],['../classaudio__tools_1_1_generator_from_array.html#a913c911a6aff6d8c9b3deb24469ea336',1,'audio_tools::GeneratorFromArray::readSample()'],['../classaudio__tools_1_1_generator_from_stream.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::GeneratorFromStream::readSample()'],['../classaudio__tools_1_1_pink_noise_generator.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::PinkNoiseGenerator::readSample()'],['../classaudio__tools_1_1_white_noise_generator.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::WhiteNoiseGenerator::readSample()'],['../classaudio__tools_1_1_saw_tooth_generator.html#a45b168302ee30ce87241d8987e5f9adf',1,'audio_tools::SawToothGenerator::readSample()'],['../classaudio__tools_1_1_fast_sine_generator.html#a45b168302ee30ce87241d8987e5f9adf',1,'audio_tools::FastSineGenerator::readSample()'],['../classaudio__tools_1_1_square_wave_generator.html#a408eeda85d9e14954a97f2c80e130320',1,'audio_tools::SquareWaveGenerator::readSample()'],['../classaudio__tools_1_1_sine_wave_generator.html#a45b168302ee30ce87241d8987e5f9adf',1,'audio_tools::SineWaveGenerator::readSample()'],['../classaudio__tools_1_1_sound_generator.html#a1ff01a896ef633c0bdf60dbf1448c2db',1,'audio_tools::SoundGenerator::readSample()'],['../classaudio__tools_1_1_audio_effects.html#a02a8b1a055e1177e195db62f9529118f',1,'audio_tools::AudioEffects::readSample()'],['../classaudio__tools_1_1_s_t_k_generator.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::STKGenerator::readSample()'],['../classaudio__tools_1_1_silence_generator.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::SilenceGenerator::readSample()'],['../classaudio__tools_1_1_sound_generator_modulation.html#a45b168302ee30ce87241d8987e5f9adf',1,'audio_tools::SoundGeneratorModulation::readSample()']]], + ['readsample_2849',['readSample',['../namespaceaudio__tools.html#a4ce58b1cf7c8f2758bd2f7ac29d8bd5d',1,'audio_tools::readSample()'],['../classaudio__tools_1_1_synthesizer.html#a3196b8713184e130cc528f812af295b9',1,'audio_tools::Synthesizer::readSample()'],['../classaudio__tools_1_1_default_synthesizer_channel.html#a4a3e93a68ae7b16f4c0e3c658d6f33b3',1,'audio_tools::DefaultSynthesizerChannel::readSample()'],['../classaudio__tools_1_1_abstract_synthesizer_channel.html#ae67870232b4db5acddcd0e80e0022621',1,'audio_tools::AbstractSynthesizerChannel::readSample()'],['../classaudio__tools_1_1_test_generator.html#a913c911a6aff6d8c9b3deb24469ea336',1,'audio_tools::TestGenerator::readSample()'],['../classaudio__tools_1_1_generator_mixer.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::GeneratorMixer::readSample()'],['../classaudio__tools_1_1_sine_from_table.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::SineFromTable::readSample()'],['../classaudio__tools_1_1_generator_fixed_value.html#a913c911a6aff6d8c9b3deb24469ea336',1,'audio_tools::GeneratorFixedValue::readSample()'],['../classaudio__tools_1_1_generator_from_array.html#a913c911a6aff6d8c9b3deb24469ea336',1,'audio_tools::GeneratorFromArray::readSample()'],['../classaudio__tools_1_1_generator_from_stream.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::GeneratorFromStream::readSample()'],['../classaudio__tools_1_1_pink_noise_generator.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::PinkNoiseGenerator::readSample()'],['../classaudio__tools_1_1_white_noise_generator.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::WhiteNoiseGenerator::readSample()'],['../classaudio__tools_1_1_saw_tooth_generator.html#a45b168302ee30ce87241d8987e5f9adf',1,'audio_tools::SawToothGenerator::readSample()'],['../classaudio__tools_1_1_square_wave_generator.html#a408eeda85d9e14954a97f2c80e130320',1,'audio_tools::SquareWaveGenerator::readSample()'],['../classaudio__tools_1_1_fast_sine_generator.html#a45b168302ee30ce87241d8987e5f9adf',1,'audio_tools::FastSineGenerator::readSample()'],['../classaudio__tools_1_1_sine_wave_generator.html#a45b168302ee30ce87241d8987e5f9adf',1,'audio_tools::SineWaveGenerator::readSample()'],['../classaudio__tools_1_1_sound_generator.html#a1ff01a896ef633c0bdf60dbf1448c2db',1,'audio_tools::SoundGenerator::readSample()'],['../classaudio__tools_1_1_audio_effects.html#a02a8b1a055e1177e195db62f9529118f',1,'audio_tools::AudioEffects::readSample()'],['../classaudio__tools_1_1_s_t_k_generator.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::STKGenerator::readSample()'],['../classaudio__tools_1_1_silence_generator.html#adc79c89fc1d63b418c9f074b63f3d651',1,'audio_tools::SilenceGenerator::readSample()'],['../classaudio__tools_1_1_sound_generator_modulation.html#a45b168302ee30ce87241d8987e5f9adf',1,'audio_tools::SoundGeneratorModulation::readSample()']]], ['readsamples_2850',['readSamples',['../namespaceaudio__tools.html#a05732a8617ebf1fc88e99fa12d8f5f85',1,'audio_tools']]], ['readsilence_2851',['readSilence',['../classaudio__tools_1_1_audio_stream.html#a36e26f40121eda38b0042dcba026ab82',1,'audio_tools::AudioStream']]], ['readstream_2852',['readStream',['../classaudio__tools_1_1_wav_i_m_a_decoder.html#ab754136602e0bb22ec2be26dedd9ff50',1,'audio_tools::WavIMADecoder']]],
defaultConfig() overrideSineWaveGenerator< T >inlinevirtual
double_Pi (defined in SineWaveGenerator< T >)SineWaveGenerator< T >protected
end()SoundGenerator< T >inlinevirtual
info (defined in SoundGenerator< T >)SoundGenerator< T >protected
isActive()SoundGenerator< T >inlinevirtual
logStatus() (defined in SineWaveGenerator< T >)SineWaveGenerator< T >inlineprotected
m_amplitude (defined in SineWaveGenerator< T >)SineWaveGenerator< T >protected
m_cycles (defined in SineWaveGenerator< T >)SineWaveGenerator< T >protected
m_deltaTime (defined in SineWaveGenerator< T >)SineWaveGenerator< T >protected
m_frequency (defined in SineWaveGenerator< T >)SineWaveGenerator< T >protected
m_phase (defined in SineWaveGenerator< T >)SineWaveGenerator< T >protected
readBytes(uint8_t *data, size_t len)SoundGenerator< T >inlinevirtual
readBytesFrames(uint8_t *buffer, size_t lengthBytes, int frames, int channels) (defined in SoundGenerator< T >)SoundGenerator< T >inlineprotected
readBytesFromBuffer(uint8_t *buffer, size_t lengthBytes, int frame_size, int channels) (defined in SoundGenerator< T >)SoundGenerator< T >inlineprotected
readSample()SquareWaveGenerator< T >inlinevirtual
ring_buffer (defined in SoundGenerator< T >)SoundGenerator< T >protected
setAmplitude(float amp) (defined in SineWaveGenerator< T >)SineWaveGenerator< T >inline
setAudioInfo(AudioInfo info) overrideSineWaveGenerator< T >inlinevirtual
setFrequency(float frequency) overrideSineWaveGenerator< T >inlinevirtual
FastSineGenerator(float amplitude=32767.0, float phase=0.0) (defined in FastSineGenerator< T >)FastSineGenerator< T >inline
info (defined in SoundGenerator< T >)SoundGenerator< T >protected
isActive()SoundGenerator< T >inlinevirtual
logStatus() (defined in SineWaveGenerator< T >)SineWaveGenerator< T >inlineprotected
m_amplitude (defined in SineWaveGenerator< T >)SineWaveGenerator< T >protected
m_cycles (defined in SineWaveGenerator< T >)SineWaveGenerator< T >protected
m_deltaTime (defined in SineWaveGenerator< T >)SineWaveGenerator< T >protected
m_frequency (defined in SineWaveGenerator< T >)SineWaveGenerator< T >protected
m_phase (defined in SineWaveGenerator< T >)SineWaveGenerator< T >protected
readBytes(uint8_t *data, size_t len)SoundGenerator< T >inlinevirtual
readBytesFrames(uint8_t *buffer, size_t lengthBytes, int frames, int channels) (defined in SoundGenerator< T >)SoundGenerator< T >inlineprotected
readBytesFromBuffer(uint8_t *buffer, size_t lengthBytes, int frame_size, int channels) (defined in SoundGenerator< T >)SoundGenerator< T >inlineprotected
readSample()SquareWaveGenerator< T >inlinevirtual
ring_buffer (defined in SoundGenerator< T >)SoundGenerator< T >protected
setAmplitude(float amp) (defined in SineWaveGenerator< T >)SineWaveGenerator< T >inline
setAudioInfo(AudioInfo info) overrideSineWaveGenerator< T >inlinevirtual
setFrequency(float frequency) overrideSineWaveGenerator< T >inlinevirtual
sine(float t)FastSineGenerator< T >inlineprotected
SineWaveGenerator(float amplitude=0.9f *NumberConverter::maxValueT< T >(), float phase=0.0f) (defined in SineWaveGenerator< T >)SineWaveGenerator< T >inline
SoundGenerator() (defined in SoundGenerator< T >)SoundGenerator< T >inline
SquareWaveGenerator(float amplitude=32767.0f, float phase=0.0f) (defined in SquareWaveGenerator< T >)SquareWaveGenerator< T >inline
size_t readBytesFromBuffer (uint8_t *buffer, size_t lengthBytes, int frame_size, int channels)
 
+float sine (float t)
 sine approximation.
 
value (T value, T amplitude)
 
 Generates pink noise. More...
 
class  SawToothGenerator< T >
 Sine wave which is based on a fast approximation function. More...
 SawToothGenerator. More...
 
class  SilenceGenerator< T >
 Provides a fixed value (e.g. 0) as sound data. This can be used e.g. to test the output functionality which should optimally just output silence and no artifacts. More...
 Simple Facade which can turn any Stream into a IAudioSource. This way we can e.g. use an I2SStream as source to stream data Depends on the https://github.com/pschatzmann/Micro-RTSP-Audio/ library. More...
 
class  SawToothGenerator
 Sine wave which is based on a fast approximation function. More...
 SawToothGenerator. More...
 
class  SBCDecoder
 Decoder for SBC. Depends on https://github.com/pschatzmann/arduino-libsbc. Inspired by sbcdec.c. More...