Source: https://mokxi.com/errors/audio-h-no-such-file-or-directory
Updated: 2026-11-16

Home / Errors
Arduino build error

# fatal error: Audio.h: No such file or directory

Audio.h is not part of Arduino itself. Sketches that play web radio or MP3 on an ESP32 include it from the ESP32-audioI2S library.

Try the fixed sketch in Mokxi See the causes

- Build error
- 2 common causes

The message

## What the Arduino IDE prints

Output window

The library has to be installed, and the board has to be an ESP32.

Mokxi's compiler, clang, words it as 'Audio.h' file not found.

Causes

## The 2 usual causes with the fix

### 1The board is not an ESP32

The library plays audio through the ESP32 I2S port, so it needs an ESP32. Mokxi builds the sketch but does not play sound: the connect calls return false and say so on the serial monitor.

Broken

Fixed

Mokxi’s build tab says: Pick an ESP32 board

Try this fix in Mokxi

### 2The ESP32-audioI2S library is not installed

Install it once in the Arduino IDE. Do not confuse it with the Audio library for the Arduino Due, which has the same header name.

- Open Sketch, Include Library, Manage Libraries, and search for ESP32-audioI2S.
- Install the one by schreibfaul1, or download it from GitHub and add it as a ZIP library.
- Choose an ESP32 board under Tools, Board, then compile again.

FAQ

## Questions and answers

### Is Audio.h part of Arduino?

No. For ESP32 sketches it comes from the ESP32-audioI2S library. The Arduino Due has a different Audio library with the same header name.

### Does audio play in Mokxi?

No. There is no MP3 decoder and no I2S DAC that plays a stream, so the sketch builds and its other parts run, and the connect calls return false.

### What hardware does it need?

An ESP32 and an I2S DAC board, such as a MAX98357 amplifier, on the pins you pass to setPinout.

Next

## More errors and the longer guide

- fatal error: esp_camera.h: No such file or directory
- fatal error: WiFi.h: No such file or directory

The longer guide to this error All Arduino errors
