Problem finding .h files

I am having an awful time with this issue. I haven't even gotten to the point of debugging my code. I can't seem to get things right when it comes to including the proper libraries.

I am using the latest 2.2.1 IDE. It is a clean install with minimal libraries. I have installed the latest Espressif board files. This is for a ESP32 board. I generally use Visual Studio with VisualMicro installed for code development. The program is quite far along and working as it should. I got to the point where I needed to add the ability to play a sound file to a I2S DAC amplifier. I attempted to use Phill Schatzmann's audio tool library. That's when the trouble started. Just adding the library to the project caused it to not compile. Issues with not being able to fine the WiFiClientServer or some such thing.

I then went to the Arduino IDE and loaded in the simplest example (streams-generator-i2s.ino) which uses just one library (AudioTools.h). It compiles and runs fine. I then went to the example that plays an mp3 file from memory (streams-memory_mp3_short-i2s-2.ino). It does not compile.

Here is the code:

t/**
 * @file streams-memory_mp3_short-i2s-2.ino
 * @author Phil Schatzmann
 * @brief decode MP3 stream and output as i2s signal
 * @version 0.1
 * @date 2021-01-24
 * 
 * @copyright Copyright (c) 2021
 
 */

#include "AudioTools.h"
#include "AudioCodecs/CodecMP3Helix.h"
#include "zero.h"


MemoryStream mp3(zero_mp3, zero_mp3_len);
I2SStream i2s;  // PWM output 
MP3DecoderHelix helix;
EncodedAudioStream out(&i2s, &helix); // output to decoder
StreamCopy copier(out, mp3);    // copy in to out

void setup(){
  Serial.begin(115200);
  AudioLogger::instance().begin(Serial, AudioLogger::Info);  

  // begin processing
  auto cfg = i2s.defaultConfig();
  cfg.sample_rate = 24000;
  cfg.channels = 1;

  cfg.pin_data = 25;
  cfg.pin_bck = 32;
  cfg.pin_ws = 33;

  i2s.begin(cfg);
  out.begin();

  sayWord();

}

void sayWord() {
  Serial.println("Saying word...");
  mp3.begin(); // restart source 
  helix.begin(); // so that we can repeatedly call this method
  copier.copyAll();
  helix.end(); // flush output
}

void loop(){
}

I get the following error message:

In file included from C:\Users\xxxxxxxx\AppData\Local\Temp\.arduinoIDE-unsaved2023119-13344-1t4v450.60kh\streams-memory_mp3_short-i2s-2\streams-memory_mp3_short-i2s-2.ino:13:
D:\My Documents\Arduino\libraries\arduino-audio-tools-main\src/AudioCodecs/CodecMP3Helix.h:6:10: fatal error: MP3DecoderHelix.h: No such file or directory
 #include "MP3DecoderHelix.h"
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.

exit status 1

Compilation error: exit status 1

I have been at this all day and making no progress. Any help would be greatly appreciated.

This "t" does not belong. Remove it.

The quotes around your library files indicate the files are in the sketch folder. If the libraries you need are in the libraries folder, use less-than/greater-than.

Hi @Chevelle. The "audio-tools" library has dependencies on other libraries:

https://github.com/pschatzmann/arduino-audio-tools/wiki/Encoding-and-Decoding-of-Audio#installation

The cause of the compilation error is that you have not installed the "libhelix" library:

Install that library, just as you did with the "audio-tools" library, and then try compiling the example sketch again. Hopefully it will compile without any errors this time.

If there is still an error, just reply here to let us know and we'll help you out.

Thanks for the assistance. (The "t" was just a copy/paste error. It is not in the code.)

Loading the libhelix library did help. (Not sure why it was not a part of the other libraries if it is required. Oh well.)

One to the next issue. I now need to add in Neil Kolban's ESP32-BLE libraries. (I have other projects that have used this library with no issues but now, I can't seem to get this library to play nice.)

I have provided the code and response.

Thanks again for the help.

#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>

#include <AudioTools.h>
#include <AudioCodecs/CodecMP3Helix.h>

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

In file included from D:\My Documents\Arduino\libraries\ESP32_BLE_Arduino-master\src/BLEAdvertising.h:15,
from D:\My Documents\Arduino\libraries\ESP32_BLE_Arduino-master\src/BLEServer.h:19,
from D:\My Documents\Arduino\libraries\ESP32_BLE_Arduino-master\src/BLEDevice.h:18,
from C:\Users\xxxxxxx\AppData\Local\Temp.arduinoIDE-unsaved20231110-2036-1i78ocb.rpif\sketch_dec10a\sketch_dec10a.ino:1:
D:\My Documents\Arduino\libraries\ESP32_BLE_Arduino-master\src/FreeRTOS.h:61:28: error: 'ringbuf_type_t' has not been declared
Ringbuffer(size_t length, ringbuf_type_t type = RINGBUF_TYPE_NOSPLIT);
^~~~~~~~~~~~~~
Multiple libraries were found for "BLEDevice.h"
Used: D:\My Documents\Arduino\libraries\ESP32_BLE_Arduino-master
Not used: C:\Users\xxxxxxx\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BLE
exit status 1

Compilation error: exit status 1

type or paste code here

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.