play sound in loop #2301
-
|
Hello |
Beta Was this translation helpful? Give feedback.
Replies: 13 comments 3 replies
-
|
The AudioPlayer is not designed for this. |
Beta Was this translation helpful? Give feedback.
-
|
Okay thanks for your answare. I will try your excample Phil. |
Beta Was this translation helpful? Give feedback.
-
|
Hello Phil, Fatal error: AudioBoard.h: No such file or directory I installed your file “arduino-audio-tools-main.zip” via the Arduino IDE. What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
-
|
I believe FileLoop.h and AudioSourceSD.h do not work together. error: #include expects "FILENAME" or Here is an excerpt from my sketch. #include <SPI.h> //Uncomment and set up if you want to use custom pins for the SPI communication //#define TFT_WIDTH 320 #define I2S_PORT I2S_NUM_0 // MAX98357 // Audio parameters // Channels // Buffer size (frames, not samples) // Stereo buffer: Left, Right #define PATH "/doorbell" //int PIN_AUDIO_KIT_SD_CARD_CS = 10; |
Beta Was this translation helpful? Give feedback.
-
|
This does not make any sense: AudioSourceSD is for the AudioPlayer! |
Beta Was this translation helpful? Give feedback.
-
|
And how can I mount the SD card without AudioSourceSD? |
Beta Was this translation helpful? Give feedback.
-
|
Hello Phil, I have mountet my sd card, and the player stopped working. This is my output from the serial monitor. FILE: doorbell2-6450.mp3 SIZE: 196800 |
Beta Was this translation helpful? Give feedback.
-
|
Build:Mar 27 2021 |
Beta Was this translation helpful? Give feedback.
-
|
Hello Phil, this is my sketch. In the moment I have no sound :-(. #include "FS.h" Adafruit_VL6180X vl = Adafruit_VL6180X(); //Uncomment and set up if you want to use custom pins for the SPI communication #define I2S_PORT I2S_NUM_0 // MAX98357 // Audio parameters // Channels // Buffer size (frames, not samples) // Stereo buffer: Left, Right I2SStream i2s; void setup() { SPI.begin(sck, miso, mosi, cs); uint8_t cardType = SD.cardType(); if (cardType == CARD_NONE) { Serial.print("SD Card Type: "); uint64_t cardSize = SD.cardSize() / (1024 * 1024); } Serial.println("Adafruit VL6180x test!"); AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Info); // setup I2S based on sampling rate provided by decoder } void loop() { copier.copy(); } |
Beta Was this translation helpful? Give feedback.
-
|
This is the output of my serial monitor. SD Card Type: SDHC |
Beta Was this translation helpful? Give feedback.
-
|
I assume that you have many other copy lines after that! If this is the case the overall processing logic is working. If you dont get any audio you need to figure out the root cause:
Here are some more hints |
Beta Was this translation helpful? Give feedback.
-
|
Hello Phil //I assume that you have many other copy lines after that! If this is the case the overall processing logic is working. Yes, that's right. //If you dont get any audio you need to figure out the root cause: The sound runs through the small MAX98357 amplifier. // Does the Audio Output work: did you test e.g. with a sine tone ? // Does the decoding with the file w/o loop work ? // Does the decoding with another mp3 file work ? //Is your mp3 file really 24000 / channels: 1 ? My first guess would be that this is just one more case which excessive metadata. I have set a sample rate of 44100, which also works with the audio player. When I transfer my MAX98357 pins to the i2s, it crashes. There is no transmission in the loop. Could that possibly be the reason? |
Beta Was this translation helpful? Give feedback.
-
|
Hello Phil, okay it funzt. Thanks for you help :-) |
Beta Was this translation helpful? Give feedback.
The AudioPlayer is not designed for this.
Why don't you just use a FileLoop like in this example ?