Anyone got experience with A) Desktop Emulation and B) Microphones? #38
-
Ultimately, I want to use the esp32-a1s audio kit to do all this, but it's a long road, so I'm trying to use a desktop emulation example to develop and prototype this. So I took Phil Schatzmann's excellent desktop "generator" example, and tried to initialize "in", which definitely doesn't seem to work: uint16_t sample_rate=44100; PortAudioStream out; // On desktop we use StreamCopy copier(out, in); // copy in to out // Arduino Setup // open output incfg.sample_rate = sample_rate; ret = out.begin(config); // Setup MIC? ALSA lib pcm.c:8568:(snd_pcm_recover) underrun occurred ALSA lib pcm.c:8568:(snd_pcm_recover) underrun occurred This repeats, of course. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
I have never tried: but you would use just one PortAudioStream object for input and output. In the config you would set intput = true. Then you should be able to read and write. This is similar to I2S . I also just added the defaultConfig() method that accepts a mode parameter - like in AudioKitStream and I2Stream. So you can now call defaultConfig(RXTX_MODE); |
Beta Was this translation helpful? Give feedback.
-
Like this? uint16_t sample_rate=44100; // Arduino Setup // open output // Arduino loop Works, (thank-you very much!) but there are two issues: ALSA lib pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Connection refused ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card [I] AudioCopy.h : 121 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops and |
Beta Was this translation helpful? Give feedback.
-
I haven't used this much so I can't really help. Just to give a heads up: this will work perfectly in the AudioKit: just use aud.defaultConfig(RXTX_MODE); |
Beta Was this translation helpful? Give feedback.
-
Well, it's for both platformio and your libraries, I mean, I'm hoping to just use desktop stuff for the short term, this ultimately ends up on the esp32. Desktop = faster compile .. thanks for that! |
Beta Was this translation helpful? Give feedback.
-
Just a word of caution: The floating point operations on a microcontroller are much slower than on a desktop, so you will be limited in the size of the filters. Therefore you need to keep them as small as possible! |
Beta Was this translation helpful? Give feedback.
I have never tried: but you would use just one PortAudioStream object for input and output. In the config you would set intput = true. Then you should be able to read and write. This is similar to I2S .
I also just added the defaultConfig() method that accepts a mode parameter - like in AudioKitStream and I2Stream. So you can now call defaultConfig(RXTX_MODE);