I realise that there are Audio Processing plugins which exist such as "Downmix" and "Equalizer".
Is there a reference anywhere as to how to create my own custom Audio Processor. I already have my code for the processing part. I just need an indication as to how to integrate it with the I2s streams coming in and going out.
If I could find the source code to the "Equalizer" plugin (not the API example), it would point me in the right direction. Is it publicly available?
If not, a simple demo plugin such as a "null" or "phase invert" demo would do, as long as it has the plumbing.
Creating my own custom Audio Processing stream plugin
Re: Creating my own custom Audio Processing stream plugin
OK, I've figured most of it out now.
it turns out that components/esp-adf-libs/esp_codec/equalizer.c IS the glue code.
I've successfully managed to take it and creat a NULL plugin, ready for my insertion of a replacement for the call to esp_equalizer_process, for my transform.
The only thing left for me to take into consideration is to queue the stream bytes into blocks, as my transform expects a fixed block size. I will use a sliding window to mask the block boundaries.
My hardware setup which is PCM1808 ADC->ESP32->PCM5102A is producing stream messages of length 100. What is that? 32+32 bit words times 100?
it turns out that components/esp-adf-libs/esp_codec/equalizer.c IS the glue code.
I've successfully managed to take it and creat a NULL plugin, ready for my insertion of a replacement for the call to esp_equalizer_process, for my transform.
The only thing left for me to take into consideration is to queue the stream bytes into blocks, as my transform expects a fixed block size. I will use a sliding window to mask the block boundaries.
My hardware setup which is PCM1808 ADC->ESP32->PCM5102A is producing stream messages of length 100. What is that? 32+32 bit words times 100?
Re: Creating my own custom Audio Processing stream plugin
Hi, would you kindly share your code here? I'm planning to do some signal processing on LyraT.
Thanks in advance
Thanks in advance
Re: Creating my own custom Audio Processing stream plugin
Take a good look at https://github.com/espressif/esp-adf-li ... qualizer.c and https://github.com/espressif/esp-adf-li ... qualizer.h.
Replace the calls to anything declared in esp_equalizer.h, to your own replacements.
Oh, top tip... in equalizer.c
#define BUF_SIZE (100)
Change 100 for a multiple of your I2S stereo word size, e.g. 100 is not a multiple of 8 bytes (32 bit stereo), so try 96 or 128? If you don't, you'll get a nasty rasping noise.
My code will be available in due course, but there is a copyright issue I have to sort out before it goes public.
Replace the calls to anything declared in esp_equalizer.h, to your own replacements.
Oh, top tip... in equalizer.c
#define BUF_SIZE (100)
Change 100 for a multiple of your I2S stereo word size, e.g. 100 is not a multiple of 8 bytes (32 bit stereo), so try 96 or 128? If you don't, you'll get a nasty rasping noise.
My code will be available in due course, but there is a copyright issue I have to sort out before it goes public.
Re: Creating my own custom Audio Processing stream plugin
Thank you for your useful hints. Indeed, it was actually quite easy.
In case anyone is interested, I have implemented a simple nullpipe component which is used in an example (see appendix). I also managed to put an IIR filter from https://github.com/espressif/esp-dsp into the pipe, which is quite simple and straightforward.
In case anyone is interested, I have implemented a simple nullpipe component which is used in an example (see appendix). I also managed to put an IIR filter from https://github.com/espressif/esp-dsp into the pipe, which is quite simple and straightforward.
- Attachments
-
- pipeline_nullpipe.zip
- (1.33 MiB) Downloaded 818 times
-
- Posts: 1
- Joined: Mon Mar 15, 2021 1:20 pm
Re: Creating my own custom Audio Processing stream plugin
hey, can you please share the code with the IIR filter implemented in the nullpipeline.
Who is online
Users browsing this forum: No registered users and 45 guests