Closed mkoppanen closed 1 year ago
If you want to use this, you will need to install my extended version of Mozzi: https://github.com/pschatzmann/Mozzi You find the example in the sandbox, because I never officially released this.
Maybe it is better to use the Standard output functionality of Mozzi itself w/o the AudioTools. What Processor are you using ?
The AudioTools currently has a White Noise Generator, but I can add a Pink noise generator as well
I just added the Pink Noise Generator. The test sketch looks as follows:
#include "AudioTools.h"
uint16_t sample_rate=32000;
uint8_t channels = 2; // The stream will have 2 channels
PinkNoiseGenerator<int16_t> noise(32000); // subclass of SoundGenerator with max amplitude of 32000
GeneratedSoundStream<int16_t> sound(noise); // Stream generated from sine wave
I2SStream out;
StreamCopy copier(out, sound); // copies sound into i2s
// Arduino Setup
void setup(void) {
// Open Serial
Serial.begin(115200);
AudioLogger::instance().begin(Serial, AudioLogger::Info);
// start I2S
Serial.println("starting I2S...");
auto config = out.defaultConfig(TX_MODE);
config.sample_rate = sample_rate;
config.channels = channels;
config.bits_per_sample = 16;
out.begin(config);
// Setup Pink noise
sound.begin(config);
Serial.println("started...");
}
// Arduino loop - copy sound to out
void loop() {
copier.copy();
}
@pschatzmann Amazing! Thank you very much for quick replies. I'll give it a spin.
I got a couple of different boards ESP32-WROOM-32D, ESP32-WROOM-32D, ESP32-CAM and a few m5stack atom lites. At the moment the board I am testing with is ESP32-WROOM-32D.
I am trying to get the mozzi integration running in order to create a pink noise generator for my toddler. At the moment running into a few issues with https://github.com/pschatzmann/arduino-audio-tools/tree/main/examples/sandbox/streams-mozzi-a2dp
If I take the sketch as is it fails to compile with:
I assume the above is for missing include for AudioMozzi.h
Additionally I cannot for the life of me find Mozzi.h referenced here: https://github.com/pschatzmann/arduino-audio-tools/blob/main/src/AudioLibs/AudioMozzi.h#L7
i don't have much experience (none) with Mozzi yet but the main header they have seems to be called MozziGuts.h (https://github.com/sensorium/Mozzi/blob/master/MozziGuts.h)
Am on the wrong track here or is the integration currently broken?