Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't completely load any Audio example #63

Open
richonguzman opened this issue Nov 13, 2024 · 17 comments
Open

Can't completely load any Audio example #63

richonguzman opened this issue Nov 13, 2024 · 17 comments
Labels

Comments

@richonguzman
Copy link

tried using the "Audio.h" for playing a mp3 file through T-deck speaker, but cant find a way to even import libraries needed on platformio to make use of the speaker play.

any small guide as which library to use?

@lewisxhe
Copy link
Contributor

lewisxhe commented Nov 14, 2024

Copies of all used example libraries are placed in the lib directory

“Audio.h” is here
https://github.com/Xinyuan-LilyGO/T-Deck/tree/master/lib/ESP32-audioI2S

@richonguzman
Copy link
Author

Copies of all used example libraries are placed in the lib directory

“Audio.h” is here https://github.com/Xinyuan-LilyGO/T-Deck/tree/master/lib/ESP32-audioI2S

should this also work if using Platformio instead of Arduino IDE ?

@lewisxhe
Copy link
Contributor

Of course it works. There is no difference between the two except the way they are built.

@richonguzman
Copy link
Author

I copy all the "ESP32-audioI2S" folder into /lib folder of my project.

then I compile in Platformio with this:

`
#include "Audio.h"
#include "FS.h"

#ifdef HAS_I2S

namespace AUDIO_Utils {

    void setup() {
        // nothing yet
    }

}

#endif`

I get :

/Users/myUserName/.platformio/packages/[email protected]/libraries/SD_MMC/src/SD_MMC.h:21:10: fatal error: FS.h: No such file or directory

even adding: #include "FS.h" it still get this error and could not go further

@lewisxhe
Copy link
Contributor

Post your platfromio.ini

@richonguzman
Copy link
Author

[env:ttgo_t_deck_plus]
framework = arduino
monitor_speed = 115200
lib_ldf_mode = deep+
platform = espressif32 @ 6.3.1
board_build.partitions = huge_app.csv
monitor_filters = esp32_exception_decoder
board = esp32-s3-devkitc-1
board_build.mcu = esp32s3
build_flags =
${common.build_flags}
-Werror -Wall
${common.usb_flags}
-D TTGO_T_DECK_PLUS
-D BOARD_HAS_PSRAM
-D HAS_SX1262
-D GPS_BAUDRATE=38400
-D HAS_TFT
-D USER_SETUP_LOADED
-D ST7789_DRIVER
-D TFT_WIDTH=240
-D TFT_HEIGHT=320
-D TFT_RGB_ORDER=TFT_BGR
-D TFT_INVERSION_ON
-D TFT_MISO=38
-D TFT_MOSI=41
-D TFT_SCLK=40
-D TFT_CS=12
-D TFT_DC=11
-D TFT_RST=-1
-D TFT_BUSY=-1
-D TFT_BL=42
-D TFT_BACKLIGHT_ON=1
-D TOUCH_CS=-1
-D LOAD_GLCD
-D LOAD_FONT2
-D LOAD_FONT4
-D LOAD_FONT6
-D LOAD_FONT7
-D LOAD_FONT8
-D SPI_FREQUENCY=40000000
-D SPI_READ_FREQUENCY=16000000
lib_deps =
adafruit/Adafruit BusIO @ 1.16.1
adafruit/Adafruit Unified Sensor @ 1.1.14
adafruit/Adafruit BME280 Library @ 2.2.4
adafruit/Adafruit BMP280 Library @ 2.6.8
adafruit/Adafruit BME680 Library @ 2.0.4
bblanchon/ArduinoJson @ 6.21.3
h2zero/NimBLE-Arduino @ 1.4.1
jgromes/RadioLib @ 6.6.0
mathieucarbou/AsyncTCP @ 3.2.5
mathieucarbou/ESPAsyncWebServer @ 3.2.3
mikalhart/TinyGPSPlus @ 1.0.3
paulstoffregen/Time @ 1.6.1
peterus/esp-logger @ 1.0.0
shaggydog/OneButton @ 1.5.0
bodmer/TFT_eSPI @ 2.5.43

lewisxhe added a commit that referenced this issue Nov 14, 2024
@lewisxhe
Copy link
Contributor

Yours is too complicated, I added a simple playback example

@lewisxhe
Copy link
Contributor

You can try adding this in lib_deps = esphome/[email protected]

@richonguzman
Copy link
Author

richonguzman commented Nov 14, 2024

You can try adding this in lib_deps = esphome/[email protected]

added "esphome/ESP32-audioI2S @ 2.0.6" in lib_deps (and deleted the other from "/lib")

compiled just to test without adding any more code than before and same:

"In file included from /Users/ricardoguzman/.platformio/packages/[email protected]/libraries/SD_MMC/src/SD_MMC.cpp:16:
/Users/ricardoguzman/.platformio/packages/[email protected]/libraries/SD_MMC/src/SD_MMC.h:21:10: fatal error: FS.h: No such file or directory"

#include "FS.h"
^~~~~~
compilation terminated.
Compiling .pio/build/ttgo_t_deck_plus/lib735/SPIFFS/SPIFFS.cpp.o
*** [.pio/build/ttgo_t_deck_plus/libabd/SD_MMC/SD_MMC.cpp.o] Error 1

@lewisxhe
Copy link
Contributor

It seems that there is a problem with the platformio index and it cannot find the correct dependencies.

There is no problem running it alone

@richonguzman
Copy link
Author

It seems that there is a problem with the platformio index and it cannot find the correct dependencies.

There is no problem running it alone

how could I add this "alone"??

@lewisxhe
Copy link
Contributor

In my example, it is normal
7aa23db

I was wondering why this avatar looks so familiar, it turns out to be you again. Hahahaha

I just tested it in your project, please fork a fork, comment out the following header file, and it can be compiled normally. This must be caused by a problem with the reference of platformio

image

@richonguzman
Copy link
Author

In my example, it is normal 7aa23db

I was wondering why this avatar looks so familiar, it turns out to be you again. Hahahaha

I just tested it in your project, please fork a fork, comment out the following header file, and it can be compiled normally. This must be caused by a problem with the reference of platformio

image

sorry to push so much lately but I'm willing to make lots of upgrades for this!!! 😃

so:

  1. library import on platformio.ini is now : esphome/ESP32-audioI2S @ 2.0.7
  2. edited the library without "SD_MMC.h" and others.
  3. have to add "es7210" folder from T-Deck main to my own /lib

now it can be added a mp3 and plays:

but I have 2 issues:

  1. is the quality of the mp3 defined as a minimum to be listened fine?
  2. when the board finishes playing the audio it make a noise when it stops

@lewisxhe
Copy link
Contributor

  1. By looking at the source code, we can see that the volume can be set to 0~21
    void Audio::setVolume(uint8_t vol) { // vol 22 steps, 0...21
  2. What does it mean when you make a sound when you stop? How do you run it?

@richonguzman
Copy link
Author

richonguzman commented Nov 14, 2024

  1. What does it mean when you make a sound when you stop? How do you run it?

void playMP3(const String& filename) { bool findMp3 = false; findMp3 = audio.connecttoFS(SPIFFS, filename.c_str()); if (findMp3) { audio.setVolume(21); while (audio.isRunning()) { audio.loop(); // delay(3); } /*audio.setVolume(0); delay(10); audio.stopSong(); delay(50);*/ //audio.stop(); } }

non of this posible added mods allow me to play a mp3 and avoid the 0,5sec crack sound when play stops

@lewisxhe
Copy link
Contributor

I didn't notice any popping sounds when I ran it. Does this have anything to do with the audio file?

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants