Code Monkey home page Code Monkey logo

arduino-audiokit's Introduction

Arduino ADF/AudioKit HAL


Please note that I do not support this library any more!

I recommend that you start to use my new, more flexible audio-driver library instead


There are different ESP32 Audio boards available that can be programmed with the Espressif ADF Framework.

Audio Kit

The ADF Framework contains an abstraction layer to support different codec audio chips (ES8388, ES8311, AC101...) which need to be configured usually via I2C.

Unfortunately ADF can not be used in Arduino, but it would be quite useful to have this functionality also available.

Because I wanted to have a proper support of the AudioKit for my Arduino Audio Tools library and since my Audio Tools are header only, I decided to provide this functionality in a separate project.

I converted the audio_boards and their related drivers into an Arduino Library and provide an easy to use C++ class which configures both the CODEC and I2S. I also tried to abstract away all ESP32 specific funcationality.

The following functionality is supported

  • management of different audio codec (starting, stopping, setting volume etc)
  • optional I2S output (ESP32 only)
  • optional SD support via SPI
  • information about board specific pins

So with this project it should now get quite easy to use these boards also in Arduino.

Configuration

You must define your board and the default settings in the libraries/arduino-audiokit/src/AudioKitSettings.h file. Please note that the functionlity will not work properly if this is done in the Sketch.

 * @brief AUDIOKIT_BOARD selects a specic board:
 * 1) lyrat_v4_3
 * 2) lyrat_v4_2 - DRAFT Not Tested
 * 3) lyrat_mini_v1_1 - DRAFT Not Tested
 * 4) esp32_s2_kaluga_1_v1_2 - DRAFT Not Tested
 * 5) ai_thinker (ES8388) 2957 3478 A149 2762
 * 6) ai_thinker (AC101) 2762 2957
 * 7) ai_thinker (ES8388) 2957
 * 8) esp32_s3_box DRAFT Not Tested
 * 9) esp32_s3_box_lite.h DRAFT Not Tested
 * 10) generic_es8388
 * 11) generic_es8311
 */

#define AUDIOKIT_BOARD 1

Here the lyrat v4.3 has been selected. Further information can be found in the Wiki

Unfortunately AI Thinker created a big mess with their boards using different Audio chips and pin assingments, all of them using the same version number. You might need to make an educated guess by looking at the number after the version and if you have a 2957 board, you need to check all 3 options!

Example Sketch

Here is an example sketch that writes audio data to the audio kit board via I2S. By default I2S is set up as master and the codec as slave, the sample size is 16 bits and the sample rate is 44.1k/sec - if you did not change the default settings.

You can adjust these parameters by setting your requested values in the cfg below:

#include "AudioKitHAL.h"
#include "SineWaveGenerator.h"

AudioKit kit;
SineWaveGenerator wave;
const int BUFFER_SIZE = 1024;
uint8_t buffer[BUFFER_SIZE];

void setup() {
  Serial.begin(115200);
  // open in write mode
  auto cfg = kit.defaultConfig(KitOutput);
  cfg.sample_rate = AUDIO_HAL_22K_SAMPLES;
  kit.begin(cfg);

  // 1000 hz
  wave.setFrequency(1000);
  wave.setSampleRate(cfg.sampleRate());
}

void loop() {
  size_t l = wave.read(buffer, BUFFER_SIZE);
  kit.write(buffer, l);
}

However I recommend to use my Arduino Audio Tools Library which implements an easy to use Stream API with additional functionality on top of this and it has plenty of examples.

You can also use this functionality just to set up the codec chip w/o doing any input or output. In this case you can set cfg.is_i2s_active = false;

Logging

The functionality has a built in logger. The default log level has been set to Warning. You can change it like this:

  LOGLEVEL_AUDIOKIT = AudioKitDebug; // or AudiKitInfo, AudioKitWarning, AudioKitError

Documentation

Here is the documentaion of the AudioKit class.

Further information can be found in the Wiki and my Blogs.

Support

I spent a lot of time to provide a comprehensive and complete documentation. So please read the documentation first and check the issues and discussions before posting any new ones on Github.

Open issues only for bugs and if it is not a bug, use a discussion: Provide enough information about

  • the selected scenario/sketch
  • what exactly you are trying to do
  • your hardware
  • your software versions
  • what exactly your problem is

to enable others to understand and reproduce your issue.

Finally, don't send me any e-mails or post questions on my personal website!

Installation in Arduino

You can download the library as zip and call include Library -> zip library. Or you can git clone this project into the Arduino libraries folder e.g. with

cd  ~/Documents/Arduino/libraries
git clone https://github.com/pschatzmann/arduino-audiokit.git

If you want to use the library in PlatformIO, you can find a detailed description in the Wiki.

Supported Devices / Processors

The examples have been tested with a AI Thinker v2.2: both versions - the one with the ES8388 and the other with the AC101. I also tested with a LyraT. I do not own any other AudioKit devices, so I can't guarantee that they work properly. I also made sure that the code is compiling on other processors, but I did not perform any tests. Please note that in this case because I2S is not standardized in Arduino, you need to take care of the I2S initialization and processing yourself on non ESP32 boards.

arduino-audiokit's People

Contributors

flos avatar gaai avatar platevoltage avatar pschatzmann avatar timeylies avatar vchekan avatar youqi66 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino-audiokit's Issues

Bad quality when forwarding audio in to output

I am planning to implement an audio filter using my esp32 audio kit (v2.2 ESP32-A1S 2974)

When I am simply trying to forward audio input directly to output, I am getting very bad quality sound. Is there anyway to improve this?

#include <Arduino.h>
#include <Wire.h>

// #define AUDIOKIT_BOARD 1

#include "AudioKitHAL.h"
#include "SineWaveGenerator.h"

AudioKit kit;
SineWaveGenerator wave;
const int BUFFER_SIZE = 1024;
uint8_t buffer[BUFFER_SIZE];

void setup()
{
  LOGLEVEL_AUDIOKIT = AudioKitInfo;
  Serial.begin(115200);

  auto cfg = kit.defaultConfig();
  cfg.adc_input = AUDIO_HAL_ADC_INPUT_LINE2;
  cfg.sample_rate = AUDIO_HAL_16K_SAMPLES;

  kit.begin(cfg);
}

void loop()
{
  size_t len = kit.read(buffer, BUFFER_SIZE);

  // HERE will be some code to apply filters

  kit.write(buffer, len);
}

Full repo example https://github.com/apiel/esp32-filter-effect

ESP-IDF version?

Hello, I am having trouble getting this working with an AC101 kit (2957)

What version of ESP-IDF would you recommend? The issue seems to arise in esp-idf/components/driver/i2s.c

Output as follows:

Info: bool AudioKit::begin(AudioKitConfig)
Info: Selected board: 6
Info: headphone detection is active
Debug: audio_hal_init
Debug: audio_calloc: 1 * 36
Info: i2c port configured!!!!
Error: reset failed!
Debug: audio_codec_initialize -> -1
Debug: audio_free
Error: codec init failed!
Error: audio_hal_init
Debug: write: 1024
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.

Core 1 register dump:
PC : 0x400d7524 PS : 0x00060830 A0 : 0x800d19e4 A1 : 0x3ffb2790
A2 : 0x00000000 A3 : 0x3ffc1180 A4 : 0x00000400 A5 : 0x3ffb27fc
A6 : 0xffffffff A7 : 0x3ffc17b0 A8 : 0x00000000 A9 : 0x3ffb2650
A10 : 0x00000015 A11 : 0x3ffb88d4 A12 : 0x3ffb27b0 A13 : 0x3ffb26a0
A14 : 0x00000004 A15 : 0xff000000 SAR : 0x00000004 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000018 LBEG : 0x40086791 LEND : 0x400867a1 LCOUNT : 0xffffffff

Backtrace:0x400d7521:0x3ffb27900x400d19e1:0x3ffb27d0 0x400d3f75:0x3ffb2820

#0 0x400d7521:0x3ffb2790 in i2s_write at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/driver/i2s.c:2087 (discriminator 2)
#1 0x400d19e1:0x3ffb27d0 in AudioKit::write(void const*, unsigned int, unsigned int) at .pio/libdeps/esp32dev/audiokit/src/AudioKitHAL.h:365
(inlined by) loop() at src/main.cpp:25
#2 0x400d3f75:0x3ffb2820 in loopTask(void*) at C:/Users/catfl/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:50

Have you had AUDIO_HAL_ADC_INPUT_LINE1 work?

I noticed in the input example you used AUDIO_HAL_ADC_INPUT_LINE2. I'm not sure how the two mics on the AudioKit are wired but is AUDIO_HAL_ADC_INPUT_LINE1 supposed to work as microphone input too? It doesn't for me. And I'm wondering if this is a defect on my board or pretty common.

Line1 seems to be the default input AudioKitSettings.h:
#define AUDIOKIT_DEFAULT_INPUT AUDIO_HAL_ADC_INPUT_LINE1
And in AudioKitHAL.h:
audio_hal_adc_input_t adc_input = AUDIOKIT_DEFAULT_INPUT; /*!< set adc channel with audio_hal_adc_input_t*/

So I guess you had it working once.

No headphone output for AudioKit on LyraT 4.3 board

I tried the examples for AudioKit on LyraT 4.3 board, no headphone output. Debug info shows HEDPHONE_DETECT=-1 even if head phone is plugged in. The cause of it lies in lyrat_v4_3.h.

Line 72: #define HEADPHONE_DETECT 19
Line 77: #define HEADPHONE_DETECT -1

Line 77 override the value of HEADPHONE_DETECT and set it to -1.
After remote this line, the headphone output is correct.

Incorrect button definitions?

Using a LyraT V4.3 (board type set to 1 in platformio.ini), when I use the BUTTON_PLAY_ID macro, the buttons for Play and Set are swapped.

BUTTON_PLAY_ID resolves to PIN_KEY4, and that in turn resolves to 32. Going by the LyraT V4.3 schematic, GPIO32 is correct for touchpad button 4, but that is the Set button, not Play. It looks to me that the BUTTON_xxx definitions in audiokit_board.h are based on the LyraT board, but if that is the case, then the BUTTON_PLAY_ID and BUTTON_SET_ID macros are reversed. (The physical button locations and GPIO assignments are the same on LyraT 4, 4.2, and 4.3.)

Adding #defines for BUTTON_PLAY_ID and BUTTON_SET_ID to lyrat_v4_3.h doesn't work, since audiokit_board.h then redefines them back to the incorrect GPIOs. (Adding both the two #defines to lyrat_v4_3.h and adding #ifndef directives to audiokit_board.h does work.)

Am I missing something, or is this actually a bug?

Thanks and regards from Zurich,
Antonio

Question: codec mode and input settings (line in)

Why is LINE_IN in the audio_hal_codec_mode_t setting and not in the audio_hal_adc_input_t setting?
Isn't it possible to have AUDIO_HAL_CODEC_MODE_BOTH activated and still LINE_IN selected as Input source? (simultaneously doing line in and line out)

Problem with base-i2s-a2dp

I have problem with getting the example to work. I can verify that the connection to the speaker work with bt_music_sender.ino. I have also verified that the I2S-microphone connection works with code from https://github.com/atomic14/esp32-i2s-mic-test, configured to use the same pins on my ESP32 DEVKITV1 as the base-i2s-a2dp example. Though, one thing that I had to change was to connect the L/R pin to Vcc for I2S_CHANNEL_FMT_ONLY_LEFT which was the opposite with the wiring for the example. But I still don't get any sound in the speaker in the base-i2s-a2dp example. So it is possible that this indicates that the ESP-IDF driver somehow has switched L/R memory internally compared to some legacy version. But there are other differences with the esp32-i2s-mic-test seem to use the microphone in mono mode but the base-i2s-a2dp example uses a different mode, I2S_CHANNEL_FMT_RIGHT_LEFT, sampling rate is different and there might be other differences that I have not noticed.

I am open for suggestions on what to test but I currently don't understand the i2s or esp32 hardware or the code in base-i2s-a2dp to figure out myself where the problem can be.

LyraT 4.3 PA chip works with headphone plugged in

Problem Description

I don't know if this falls under the audiokit repo or your audio-tools but I am having issues with the L/R speakers on the LyraT 4.3. They only activate when I plug a headphone in. Shouldn't this be the other way around?

Device Description

LyraT 4.3

Sketch

Using player-sd_a2dp-audiokit example from audio-tools

Other Steps to Reproduce

No response

Provide your Version of the EP32 Arduino Core

No response

I have checked existing issues, discussions and online documentation

  • I confirm I have checked existing issues, discussions and online documentation

SD card via SDMMC instead of SPI?

Grรผezi Phil,

Triggered by the wiki page about SPI and I2C, I wondered if you ever considered to access the SD card over the fast SDMMC bus instead of SPI. The Audiokit datasheet suggests that the SD slot is connected to all 6 pins of ESP32's SDMMC_HOST_SLOT_1 (2, 4, 12, 13, 14 and 15, all with pullup resistors).

Using the SD_MMC library, I verified that SDMMC 1-bit mode (using GPIO 2, 14 and 15) is almost twice as fast as SPI.
(Couldn't get the even slightly faster SDMMC 4-bit mode working, so GPIO 4 and/or 12 may not actually be connected on my kit).

This is just an idea. I don't even know if SD speed could ever become a bottleneck for audio projects, but if a board's internal wiring allows it, I always prefer using the SDMMC bus.

Output example will not compile if board type is set to 6

Problem Description

Output example will not compile if board type is set to 6

Device Description

Not applicable (AI Thinker / clone from AliExpress)

Sketch

N/A  using your example unmodified

Other Steps to Reproduce

  1. Open the Output example from this repo
  2. Edit ArduinoKitSettings.h and define AUDIOKIT_BOARD 7
  3. Observe

Compile error

Arduino\libraries\arduino-audiokit\src/audio_hal/audio_hal.h:185:25: error: conflicting types for 'AUDIO_CODEC_ES8388_DEFAULT_HANDLE'
extern audio_hal_func_t AUDIO_CODEC_ES8388_DEFAULT_HANDLE;

Provide your Version of the EP32 Arduino Core

2.0.13

I have checked existing issues, discussions and online documentation

  • I confirm I have checked existing issues, discussions and online documentation

Set Mic input Gain ES8388

Hello,
I would like to change the input gain of microphone (PGA) in ES8388 .How is this possible? I couldn't find any straight forward method for it.

output.ino example stops working after a few minutes

I am encountering a strange behaviour with the output.ino example (on a LyraT board): the sinewave runs perfectly for a couple of minutes, then it suddenly changes its frequency to a lower note, and later it begins stuttering.
Is there something that I should check? This is the output of the serial monitor:

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8
Info: bool AudioKit::begin(AudioKitConfig)
Info: Selected board: 1
Info: headphone detection is active
Info: i2c sda: 18
Info: i2c scl: 23
Info: i2c clk_speed: 100000
Info: audio_codec_initialize-END-OK
Info: i2s_set_pin
Info: I2S0, MCLK output by GPIO0
Info: Codec mode is 2, Ctrl:1

Example sd_begin does not compile

Problem Description

Example sd_begin does not compile

Device Description

N/A (AI Thinker Audio kit)

Sketch

https://github.com/pschatzmann/arduino-audiokit/blob/main/examples/sd_begin/sd_begin.ino

Other Steps to Reproduce

Attemp to compile the example

https://github.com/pschatzmann/arduino-audiokit/blob/main/examples/sd_begin/sd_begin.ino

See error message

Arduino\libraries\arduino-audiokit\examples\sd_begin\sd_begin.ino: In function 'void setup()':
sd_begin:20:22: error: 'class audiokit::AudioKit' has no member named 'pinSpiCs'
if(!SD.begin(kit.pinSpiCs(), AUDIOKIT_SD_SPI)){

Provide your Version of the EP32 Arduino Core

2.0.13

I have checked existing issues, discussions and online documentation

  • I confirm I have checked existing issues, discussions and online documentation

ESP32-S3-BOX

Will this library work with board type ESP32-S3-BOX? I set
"# define AUDIOKIT_BOARD 11"
and get the following compiler errors:

In file included from /tmp/.arduinoIDE-unsaved202344-707384-8d5iyl.1o9ow/output/output.ino:10:
/home/dave/Arduino/libraries/audiokit/src/AudioKitHAL.h:34:19: error: 'VSPI' was not declared in this scope
SPIClass SPI_VSPI(VSPI);
^~~~
/home/dave/Arduino/libraries/audiokit/src/AudioKitHAL.h:34:19: note: suggested alternative: 'SPI'
SPIClass SPI_VSPI(VSPI);
^~~~
SPI
/home/dave/Arduino/libraries/audiokit/src/AudioKitHAL.h: In member function 'i2s_mode_t audiokit::AudioKitConfig::i2sMode()':
/home/dave/Arduino/libraries/audiokit/src/AudioKitHAL.h:199:39: error: 'I2S_MODE_DAC_BUILT_IN' was not declared in this scope
mode = mode | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN;
^~~~~~~~~~~~~~~~~~~~~
/home/dave/Arduino/libraries/audiokit/src/AudioKitHAL.h:199:39: note: suggested alternative: 'I2S_MODE_MASTER'
mode = mode | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN;
^~~~~~~~~~~~~~~~~~~~~
I2S_MODE_MASTER
/home/dave/Arduino/libraries/audiokit/src/AudioKitHAL.h:201:39: error: 'I2S_MODE_ADC_BUILT_IN' was not declared in this scope
mode = mode | I2S_MODE_RX | I2S_MODE_ADC_BUILT_IN;
^~~~~~~~~~~~~~~~~~~~~
/home/dave/Arduino/libraries/audiokit/src/AudioKitHAL.h:203:53: error: 'I2S_MODE_ADC_BUILT_IN' was not declared in this scope
mode = mode | I2S_MODE_RX | I2S_MODE_TX | I2S_MODE_ADC_BUILT_IN | I2S_MODE_DAC_BUILT_IN;
^~~~~~~~~~~~~~~~~~~~~
/home/dave/Arduino/libraries/audiokit/src/AudioKitHAL.h:203:77: error: 'I2S_MODE_DAC_BUILT_IN' was not declared in this scope
mode = mode | I2S_MODE_RX | I2S_MODE_TX | I2S_MODE_ADC_BUILT_IN | I2S_MODE_DAC_BUILT_IN;
^~~~~~~~~~~~~~~~~~~~~
/home/dave/Arduino/libraries/audiokit/src/AudioKitHAL.h:203:77: note: suggested alternative: 'I2S_MODE_MASTER'
mode = mode | I2S_MODE_RX | I2S_MODE_TX | I2S_MODE_ADC_BUILT_IN | I2S_MODE_DAC_BUILT_IN;
^~~~~~~~~~~~~~~~~~~~~
I2S_MODE_MASTER

exit status 1

Compilation error: exit status 1

The AI Thinker AudioKit A202 has a low max volume on speakers

I recently bought a ESP32 Audio KIt 2.2 A202 and used it with the basic-a2dp-audiokit example. I found that the max volume on the speakers was too low. The suggested workaround using "AI_THINKER_ES8388_VOLUME_HACK 1" did not change anything for me.

The following code change in es8388.c worked for me using bluetooth from a Samsung S20 phone:

esp_err_t es8388_set_voice_volume(int volume)
{
KIT_LOGD("es8388_set_voice_volume: %d", volume);
esp_err_t res = ESP_OK;
if (volume < 0)
volume = 0;
else if (volume > 100)
volume = 100;
//volume /= 3;;
volume = (volume*63)/100; // dataheet says only 6 bits
res = es_write_reg(ES8388_ADDR, ES8388_DACCONTROL24, volume);
res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL25, volume);
res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL26, 0);
res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL27, 0);
res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL8, 192 >> 2);
res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL9, 192 >> 2);
return res;
}

I found that I could use one more bit for the volume (7 instead of 6 bits documented in the datasheet). I also used ES8388_DACCONTROL8/9 to pump up the volume even a bit more.

Best regards,

Reinhard

My ESP32 Audio kit 2762 works with ES3833, not AC101

Hello,
Contrary to the info on the main page my ESP32 Audio Kit version 2762 works with the AUDIOKIT_BOARD=5.
As the audio codec is embedded the ESP32-A1S, not on the ESP32 Audio kit, it might be more correct to list the revision number of the ESP32-A1S instead of listing the revision number of the ESP32 Audio Kit.

The ESP32-A1S's revision is on the back of the module. Mine is 2794.

AI Thinker v2.2 3378 - Audio Left side only

I am able to get this board partially working.

The board appears to work with AUDIOKIT_BOARD values of 1 (lyrat_v4_3) or 7 (ai_thinker (ES8388) 2957).

I had to use AI_THINKER_ES8388_VOLUME_HACK, otherwise the volume levels are way too low (i.e. barely audible).

On earphones, I am only get the left audio (i.e. the right side is completely silent).

If anybody can share their solution for 3378 or point me in the rough direction to solve this, I would be grateful.

Changing MCLK Pin Default for ES8388

Hi,

I've made a custom board included ESP32 and ES8388. I've used another pin rather than GPIO0 for MCLK, but it doesn't work and I'm getting junk data. I tried to change the default MCLK pin in board_def.h and board_pins_config.c but it doesn't work. Do I have to stick to GPIO0 for MCLK?

esp32-s3-korvo-v3

Hi Sir ;

I have a esp32s3-korvo-v3 board .
I am working for bidirectional audio live streaming on http.
I got a following issue on streams_audiokit_webserver_acc example .

C:\Users\tatva\OneDrive\Documents\Arduino\libraries\arduino-audio-tools-main\src/AudioAnalog/AnalogAudioESP32.h:7:10: fatal error: soc/dac_channel.h: No such file or directory
#include "soc/dac_channel.h"

Troubles with getting aux in

I have another question,
yesterday my esp32 lyrat board arrived and i tried read out line in with the streams-audiokit-webserver_wav example from your Audio tools library. Unfortunately I dont't receive anything from the aux in line, only the microphones. I tried setting result.codec_mode to AUDIO_HAL_CODEC_MODE_LINE_IN at AudioKit.h line 37. This lead to the aux in getting send to the headphone output (without any sound of the microphones, which is good at least), but after a while I get a lot of these errors:

E (59218) I2S: /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/driver/i2s.c:1352 (i2s_read):rx NULL
Error:   i2s_read

and the audio aswell isn't received from the esp.

Do you maybe have an idea what I could do to fix this or what other approches could work? I did also tried to search through the code auf the audio hal system but I couldn't find the part where the codec_mode gets passed to the module. Maybe you know where this happens, then it might be possible to adjust it so that the audio comes through like when I set it to line_in mode and rx working aswell. Maybe initializing aux in line manually or something like that.
My overall goal is to read out the aux in and stream it on wifi. (If there is another way of doing this)

Thanks for your awesome work in your libraries and your quick respondes and help.

ES7243 erroneous value for 22.5dB volume

Problem Description

Value sent to the device for volume +22.5dB is wrong.
Code sends 0x06 when it should be 0x05. Result is that the device goes mute (as 0x06 is an invalid value).
Valid volume values are (badly) described in the User manual of the chip.

Fix is in src/audio_driver/es7243/es7243.c , l.171
ret |= es7243_write_reg(0x08, 0x06); //22.5db
becomes
ret |= es7243_write_reg(0x08, 0x05); //22.5db

Device Description

Custom

Sketch

-

Other Steps to Reproduce

Setting the volume on ES7243 with es7243_adc_set_voice_volume(60) will result in no sound instead of sound with gain of 22.5dB.

Provide your Version of the EP32 Arduino Core

nothing to do with Arduino Core

I have checked existing issues, discussions and online documentation

  • I confirm I have checked existing issues, discussions and online documentation

SD examples work with errors On Lyrat V4_3 board

I successfully ran both sd_begin.ino and sdmmc_begin.ino on a Lyrat V4_3 board. Is there a way to fix the gpio errors?

Thanks

Serial Monitor Output:

    rst:0x10 (RTCWDT_RTC_RESET),boot:0x3f (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:2
    load:0x3fff0030,len:1184
    load:0x40078000,len:13192
    load:0x40080400,len:3028
    entry 0x400805e4
    E (197) gpio: gpio_set_intr_type(148): GPIO interrupt type error
    [     9][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz
    E (25) gpio: gpio_set_intr_type(148): GPIO interrupt type error
    [    34][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=18 scl=23 freq=100000
    Card Mount Success

sd wav example no audio

SD init fine, file created, silence ( VLC ).

Mic and playback works fine in the ram example.

ESP32 S2 - Not compiling

Thanks for Both of your audio libraries, I came here after listening to a guy with the swiss accent ;)

I am trying to run "streams-audiokit-serial" on an ESP 32 S2 board (Specifically Kaluga V1.2) , but it is not compiling and throws below error.

C:\Users\User\OneDrive\Documents\Arduino\libraries\arduino-audiokit-main\src/AudioKitHAL.h:27:10: fatal error: esp_a2dp_api.h: No such file or directory
 #include "esp_a2dp_api.h"
          ^~~~~~~~~~~~~~~~
compilation terminated.

My question is did you managed to compile this for any ESP 32 S2 board ?

Thanks and Regards
JAY

Power management of ES8388 using audio-kit lib

Hi,

I've designed a custom board including ES8388 and ESP32. My board is used for a BLE application and is supplied by a battery so the power management is very critical. I'm using audio-kit library and I want to be able to turn on ES8388 whenever is needed and turn it off most of the time to save power. Tried to use kit.end() but no luck. The current consumed in different situation is as follows :

1- kit is not configured in the main() : 48 mA
2- kit is configured in the main() and it's always turned on : 90 mA
3- kit is configured but I use kit.end() when a callback occurs and current drops to : 80 mA

I was expecting the current in 3 to be the same as 1. Is it something about ESP32? maybe running kit.begin() is turning on somethings in it that kit.end() won't turn them off?
Another experiment was that I turned off the power of ES8388 (it is powered by a LDO) and the current increased up to 100mA ! so I think there is something wrong with the esp.

ESP32-S2-Kaluga-1 v1.2 + ESP-LyraT-8311a v1.2 - Doesn't work

  1. It can't compile because ESP32-S2-Wrover module which is used on the Kaluga-1 v1. 2 board doesn't have two I2S, and compilation breaks at line 150 in audiokit_board.h
  2. I've commented out lines 150-155, now it compiles ok, it talks via i2c on pins 7 and 8 with the codec 8311 successfully, but there is no sound from the generator output example.
  3. PA_Enable is on pin10, it is enabled with kit.setSpeakerActive(true);

SPI

First of all; thanks for this lib and for the audiotools lib. They are very impressive and nice to work with!
I'm trying to get SPI/mcp3008 to work on the right top header pins (gpio 22, 21, 19 and 5). I've desoldered resistors near the buttons because of a hardware bug on the buttons preventing these gpio's from being used (Ai-Thinker-Open/ESP32-A1S-AudioKit#1 (comment)). SPI/mcp3008 works fine by itself on this board now.
I'm just not getting it to play nice with arduino-audiokit. Could you give me a pointer as to were to look and possibly add modify code?

Mismatch in library properties and repo name

Problem Description

When using the name in the different references to the library or in the library properties there's a mismatch in the naming. The github repo is names: https://github.com/pschatzmann/arduino-**audiokit** The url in the properties and in the references to the library is https://github.com/pschatzmann/arduino-**audio-kit**

Device Description

Not relevant

Sketch

Not relevamt

Other Steps to Reproduce

Using the name in references or library properties will give an error trying to install it

Provide your Version of the EP32 Arduino Core

Not related to problem

I have checked existing issues, discussions and online documentation

  • I confirm I have checked existing issues, discussions and online documentation

How to select/play a single MP3 file by name

Hi there! I am looking for an implementation to have an MP3 played by the press of a button/key.
I tried changing the source, but for some reason it doesn't accept just the file, only directories.
Can you help me out with an example please? Thanks!

Audiokit v2.2 (2957), version with I2C on 32/33 - two suggestions

After I got my 'flavour' of the infamous Audiokit v2.2 (2957) with ES8388 to work, I have two suggestions that may shorten the route for other beginners:

  1. Perhaps this version of the board could be added as something like '8) ai_thinker (ES8388) 2957 (I2C on 32/33)' to the AudioKitSettings.h file, and then made selectable via #define AUDIOKIT_BOARD 8, with the following pin definitions in its board_pins_config.c file:
	i2c_config->sda_io_num = GPIO_NUM_33; 
	i2c_config->scl_io_num = GPIO_NUM_32;
	i2s_config->bck_io_num = GPIO_NUM_27;
	i2s_config->ws_io_num = GPIO_NUM_25;
	i2s_config->data_out_num = GPIO_NUM_26;
	i2s_config->data_in_num = GPIO_NUM_35;

Unlike the 18/23 version, this board has no conflict with GPIO18, so volume control through KEY5 and KEY6 will work.

  1. On this flavour of the v2.2 (ES8388) 2957 board, the current file es8388.c results in very low max volume on speakers as well as headphones. An elsewhere suggested fix that worked for me was changing function es8388_get_voice_volume() in that file as follows:
esp_err_t es8388_set_voice_volume(int volume) {
  esp_err_t res = ESP_OK;
  if (volume < 0) volume = 0;
  else if (volume > 100) volume = 100;
  volume /= 3;
  res = es_write_reg(ES8388_ADDR, ES8388_DACCONTROL4, volume);
  res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL5, volume);
  res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL24, volume);
  res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL25, volume);
  res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL26, volume);
  res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL27, volume);
  return res;
}

So perhaps this board could have its own es8388_set_voice_volume() function?

24 bit bit depth only produces 0s

Using the MWE below, I can utilise 16 and 32 bit bits per sample but 24 ominously does not work and only outputs a stream of 0s.
Replacing int24_t with int32_t and AUDIO_HAL_BIT_LENGTH_24BITS with AUDIO_HAL_BIT_LENGTH_32BITS seems to work flawlessly though, as does the original 16bit version of the code (int16_t and len/4) (input example).

I'm using an AIThinker V2.2 AC101 2748.

#include "AudioKitHAL.h"
#include "AudioTools.h"
#include "AudioBasic/Int24.h"


AudioKit kit;
const int BUFFER_SIZE = 1024;
uint8_t buffer[BUFFER_SIZE];

void printBuffer(int len){
  int24_t *value_ptr = (int24_t*) buffer;
  for (int j=0;j<len/8;j++){
    Serial.print(*value_ptr++);
    Serial.print(", ");
    Serial.println(*value_ptr++);
  }
}

void setup() {
  Serial.begin(115200);
  auto cfg = kit.defaultConfig(AudioInput);
  cfg.adc_input = AUDIO_HAL_ADC_INPUT_LINE1;
  cfg.sample_rate = AUDIO_HAL_16K_SAMPLES;
  cfg.bits_per_sample = AUDIO_HAL_BIT_LENGTH_24BITS;
  kit.begin(cfg);
}

void loop() {
  size_t len = kit.read(buffer, BUFFER_SIZE);
  printBuffer(len);
}

Improve Input Quality

Hi everyone,

I have setup the AI-Thinker Audio Kit (ES8388) with audiokit framework. I get an output and can also record via On-Board mics.
The recording quality is quite limited in my case with a high frequency noise in the background and some lower noise. It is ok but far away from perfect!
I bought an external microphone which I can plug into the line in jack plug.

  1. Which Input do I have to set for using the audio jack line in? I do currently use cfg.input_device = AUDIO_HAL_ADC_INPUT_LINE2; and tried Line1, Line3 and ALL without success.
  2. Any other options on how to improve recording quality?

How to set pin for ES8311

dear sir.
i have esp32S3 connected with es8311 module.
how to assigned pin for I2S ?

my mapping pin
// I2C pin
#define GPIO_I2C_SCL (GPIO_NUM_39)
#define GPIO_I2C_SDA (GPIO_NUM_40)
// I2S pin
#define GPIO_I2S_MCLK (GPIO_NUM_45)
#define GPIO_I2S_SCLK (GPIO_NUM_42)
#define GPIO_I2S_LRCK (GPIO_NUM_48)
#define GPIO_I2S_DIN (GPIO_NUM_41)
#define GPIO_I2S_DOUT (GPIO_NUM_47)

thank

Weired hardware revision of Esp32-audio-kit

Hi,
thanks for that huge amount of genius work!
I just checked some examples and came to a point where I need some help.
I have got some Esp32-audio-kit boards which are labeled with revision 2957 but I only can get them to work and make sound if I select the AC101 option 6.
When I listen to a url in player-url_icy-audiokit the sound is good (I had to comment out kit.processActions(); in the loop otherwise it would halt playing for a brief moment every second -- [I] AudioKit.h : 352 - static void audio_tools::AudioKitStream::actionStartStop(bool, int, void*) is somehow triggered).
In other examples the sound is heavily distorted but I hear something.
My main problem is I can't get the SD-card to be detected. I got it to work previously with the SD_MMC lib and I checked different boards, so I don't think it is a hardware issue.
That's the error from sdbegin (I tried options for boards 5 - 7 all having the same error):

[E][sd_diskio.cpp:194] sdCommand(): Card Failed! cmd: 0x00
[E][sd_diskio.cpp:775] sdcard_mount(): f_mount failed: (3) The physical drive cannot work
[E][sd_diskio.cpp:194] sdCommand(): Card Failed! cmd: 0x00
Card Mount Failed

I use PlatformIO with freshly installed libs from github (today)
Do you have any idea how I could get it to work?
Thanks in advance!

platformio.ini

[env:esp32dev]
platform = espressif32
board = esp32dev
lib_ldf_mode = deep+
lib_deps = greiman/SdFat
           https://github.com/pschatzmann/arduino-audio-tools.git
           https://github.com/pschatzmann/arduino-libhelix.git
           https://github.com/pschatzmann/arduino-audiokit.git
           https://github.com/pschatzmann/arduino-midi
framework = arduino
build_flags = -DAUDIOKIT_BOARD=6 -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-function -Wno-format-extra-args 

PlatformIO: errors compiling streams-audiokit-audiokit

Hi,

I try to use the streams-audiokit-audiokit example on my LyraT 4.3 board to send the audio from "line in" to the speaker.
I followed the hints in the wiki regarding platformio, my platformio.ini looks like this:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino

lib_deps =
    https://github.com/pschatzmann/arduino-audiokit.git
    https://github.com/pschatzmann/arduino-audio-tools.git

lib_ldf_mode = deep+
build_flags = -DCORE_DEBUG_LEVEL=5 -DAUDIOKIT_BOARD=1 

upload_port = COM4
monitor_port = COM4
monitor_speed = 115200

The example is untouched like this:

/**
 * @file streams-audiokit-audiokit.ino
 * @author Phil Schatzmann
 * @brief see https://github.com/pschatzmann/arduino-audio-tools/blob/main/examples/examples-audiokit/streams-audiokit-audiokit/README.md
 * 
 * @author Phil Schatzmann
 * @copyright GPLv3
 */


#include "AudioTools.h"
#include "AudioLibs/AudioKit.h"

AudioKitStream kit; // Access I2S as stream
StreamCopy copier(kit, kit); // copy kit to kit

// Arduino Setup
void setup(void) {
    Serial.begin(115200);
    AudioLogger::instance().begin(Serial, AudioLogger::Warning);
    
    auto cfg = kit.defaultConfig(RXTX_MODE);
    cfg.sd_active = false;
    cfg.input_device = AUDIO_HAL_ADC_INPUT_LINE2;
    kit.begin(cfg);
}

// Arduino loop - copy data
void loop() {
    copier.copy();
}

When I do a build I got lot's of errors I don't understand:

In file included from .pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioPrint.h:7:0,
                 from .pio\libdeps\esp-wrover-kit\audio-tools\src/AudioFilter/Equilizer.h:3,
                 from .pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools.h:16,
                 from C:/Users/hartmut/src/hiberbear/src/HiberBear.ino:11:
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioStreams.h:70:15: error: 'virtual int audio_tools::AudioStream::availableForWrite()' marked 'override', but does not override
   virtual int availableForWrite() override { return DEFAULT_BUFFER_SIZE; }
               ^
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioStreams.h: In member function 'virtual int audio_tools::AudioStreamWrapper::availableForWrite()':
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioStreams.h:135:54: error: 'class Stream' has no member named 'availableForWrite'
   virtual int availableForWrite() { return p_stream->availableForWrite(); }
                                                      ^
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioStreams.h: In member function 'virtual int audio_tools::ConvertedStream<T, ConverterT>::availableForWrite()':
Compiling .pio\build\esp-wrover-kit\liba19\audiokit\audio_board\ai_thinker_ac101\board.c.o
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioStreams.h:925:60: error: 'class Stream' has no member named 'availableForWrite'
Archiving .pio\build\esp-wrover-kit\lib03c\libOLED.a
         virtual int availableForWrite() { return p_stream->availableForWrite(); }
                                                            ^
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioStreams.h: In member function 'virtual int audio_tools::VolumeStream::availableForWrite()':
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioStreams.h:1078:47: error: 'class Print' has no member named 'availableForWrite'
Compiling .pio\build\esp-wrover-kit\liba19\audiokit\audio_board\ai_thinker_ac101\board_pins_config.c.o
             return p_out==nullptr? 0 : p_out->availableForWrite();
                                               ^
Archiving .pio\build\esp-wrover-kit\lib824\libNTPClient.a
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioStreams.h: In member function 'virtual int audio_tools::MeasuringStream::availableForWrite()':
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioStreams.h:1280:23: error: 'class Print' has no member named 'availableForWrite'
       return p_print->availableForWrite();
                       ^
Compiling .pio\build\esp-wrover-kit\liba19\audiokit\audio_board\ai_thinker_es8388_2957\board.c.o
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioStreams.h: In member function 'virtual int audio_tools::FilteredStream<T, TF>::availableForWrite()':.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioStreams.h:1458:28: error: 'class Stream' has no member named 'availableForWrite'
Compiling .pio\build\esp-wrover-kit\liba19\audiokit\audio_board\ai_thinker_es8388_2957\board_pins_config.c.o
           return p_stream->availableForWrite();
                            ^
Compiling .pio\build\esp-wrover-kit\liba19\audiokit\audio_board\ai_thinker_es8388_3478\board.c.o
In file included from .pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTimer/AudioTimer.h:2:0,
                 from .pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools.h:11,
                 from C:/Users/hartmut/src/hiberbear/src/HiberBear.ino:11:
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioPrint.h: In member function 'virtual size_t audio_tools::MemoryPrint::write(const uint8_t*, size_t)':
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioLogger.h:132:94: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 
has type 'size_t {aka unsigned int}' [-Wformat=]
     snprintf(AudioLogger::instance().str(), LOG_PRINTF_BUFFER_SIZE, PSTR(fmt),  ##__VA_ARGS__); \
Compiling .pio\build\esp-wrover-kit\liba19\audiokit\audio_board\ai_thinker_es8388_3478\board_pins_config.c.o
                                                                                              ^
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioLogger.h:146:83: note: in expansion of macro 'LOG_OUT_PGMEM'
 #define LOGE(fmt, ...) if (AudioLogger::instance().level()<=AudioLogger::Error) { LOG_OUT_PGMEM(AudioLogger::Error, fmt, ##__VA_ARGS__);}
                                                                                   ^
Compiling .pio\build\esp-wrover-kit\liba19\audiokit\audio_board\esp32_s2_kaluga_1_v1_2\board.c.o
Compiling .pio\build\esp-wrover-kit\liba19\audiokit\audio_board\esp32_s2_kaluga_1_v1_2\board_pins_config.c.o
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioPrint.h:692:17: note: in expansion of macro 'LOGE'
                 LOGE("Buffer too small: pos:%d, size: %lu ", pos, max_size);
                 ^
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioLogger.h:132:94: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 
has type 'size_t {aka unsigned int}' [-Wformat=]
     snprintf(AudioLogger::instance().str(), LOG_PRINTF_BUFFER_SIZE, PSTR(fmt),  ##__VA_ARGS__); \
                                                                                              ^
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioLogger.h:146:83: note: in expansion of macro 'LOG_OUT_PGMEM'
Compiling .pio\build\esp-wrover-kit\liba19\audiokit\audio_board\generic_es8388\board.c.o
 #define LOGE(fmt, ...) if (AudioLogger::instance().level()<=AudioLogger::Error) { LOG_OUT_PGMEM(AudioLogger::Error, fmt, ##__VA_ARGS__);}
                                                                                   ^
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioPrint.h:692:17: note: in expansion of macro 'LOGE'
                 LOGE("Buffer too small: pos:%d, size: %lu ", pos, max_size);
Compiling .pio\build\esp-wrover-kit\liba19\audiokit\audio_board\generic_es8388\board_pins_config.c.o
                 ^
In file included from .pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools.h:16:0,
Compiling .pio\build\esp-wrover-kit\liba19\audiokit\audio_board\lyrat_mini_v1_1\board.c.o
                 from C:/Users/hartmut/src/hiberbear/src/HiberBear.ino:11:
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioFilter/Equilizer.h: In member function 'virtual int audio_tools::Equilizer3Bands::availableForWrite()':
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioFilter/Equilizer.h:101:29: error: 'class Print' has no member named 'availableForWrite'
             return p_print->availableForWrite();
                             ^
In file included from .pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools.h:23:0,
Compiling .pio\build\esp-wrover-kit\liba19\audiokit\audio_board\lyrat_mini_v1_1\board_pins_config.c.o
                 from C:/Users/hartmut/src/hiberbear/src/HiberBear.ino:11:
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioStreamsConverter.h: In member function 'virtual int audio_tools::ChannelFormatConverterStreamT<T>::availableForWrite()':
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioStreamsConverter.h:68:43: error: 'class Print' has no member named 'availableForWrite'
           return 1.0f / factor * p_print->availableForWrite();
                                           ^
In file included from .pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools.h:23:0,
                 from C:/Users/hartmut/src/hiberbear/src/HiberBear.ino:11:
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioStreamsConverter.h: In member function 'virtual int audio_tools::NumberFormatConverterStreamT<T, TArg>::availableForWrite()':
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioStreamsConverter.h:324:27: error: 'class Print' has no member named 'availableForWrite'
           return p_print->availableForWrite();
                           ^
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioStreamsConverter.h: In member function 'virtual int audio_tools::NumberFormatConverterStream::availableForWrite()':
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioStreamsConverter.h:451:29: error: 'class Print' has no member named 'availableForWrite'
             return p_print->availableForWrite();
                             ^
In file included from .pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools.h:25:0,
                 from C:/Users/hartmut/src/hiberbear/src/HiberBear.ino:11:
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/Resample.h: In member function 'int audio_tools::Resample<T>::availableForWrite()':
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/Resample.h:76:58: error: 'class Print' has no member named 'availableForWrite'
         int availableForWrite() override { return p_out->availableForWrite(); }
                                                          ^
In file included from .pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools.h:26:0,
                 from C:/Users/hartmut/src/hiberbear/src/HiberBear.ino:11:
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioCopy.h: In member function 'size_t audio_tools::StreamCopyT<T>::copy()':
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools/AudioCopy.h:95:32: error: 'class Print' has no member named 'availableForWrite'
             int to_write = to->availableForWrite();
                                ^
In file included from .pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools.h:28:0,
                 from C:/Users/hartmut/src/hiberbear/src/HiberBear.ino:11:
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioCodecs/AudioEncoded.h: In member function 'virtual int audio_tools::EncodedAudioStream::availableForWrite()':  
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioCodecs/AudioEncoded.h:347:54: error: 'class Print' has no member named 'availableForWrite'
   int availableForWrite() override { return ptr_out->availableForWrite(); }
                                                      ^
In file included from .pio\libdeps\esp-wrover-kit\audio-tools\src/AudioHttp/AudioHttp.h:2:0,
                 from .pio\libdeps\esp-wrover-kit\audio-tools\src/AudioTools.h:30,
                 from C:/Users/hartmut/src/hiberbear/src/HiberBear.ino:11:
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioHttp/URLStream.h: In member function 'Client& audio_tools::URLStreamDefault::getClient(bool)':
.pio\libdeps\esp-wrover-kit\audio-tools\src/AudioHttp/URLStream.h:242:35: error: 'class WiFiClientSecure' has no member named 'setInsecure'
                     clientSecure->setInsecure();
                                   ^
In file included from .pio\libdeps\esp-wrover-kit\audio-tools\src/AudioLibs/AudioKit.h:4:0,
                 from C:/Users/hartmut/src/hiberbear/src/HiberBear.ino:12:
.pio\libdeps\esp-wrover-kit\audiokit\src/AudioKitHAL.h: In member function 'i2s_config_t AudioKitConfig::i2sConfig()':
.pio\libdeps\esp-wrover-kit\audiokit\src/AudioKitHAL.h:129:34: warning: narrowing conversion of 'AudioKitConfig::sampleRate()' from 'uint32_t {aka unsigned int}' to 'int' inside { } [-Wnarrowing]
         .sample_rate = sampleRate(),
                                  ^
*** [.pio\build\esp-wrover-kit\src\HiberBear.ino.cpp.o] Error 1

Can anybody give me hints on what I missed ?

Sorry for inconvinience and thanks a lot
Hartmut

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.