M5Core2 icon indicating copy to clipboard operation
M5Core2 copied to clipboard

MP3 files play with "slow" speed

Open NDC-SC opened this issue 2 years ago • 13 comments

When MP3 files are played with M5Core2 0.1.3 and the Audio libraries, the sound quality is fine. With the M5Core2 0.1.4 or 0.1.5 libraries, the MP3 files play with a "slow" speed. Instructions are #include <Audio.h> Audio audio; temp = filenames(filenumber]; // the filenumber MP3 file on the micro-SD card audio.connecttoFS(SD, temp.c_str()); // MP3 file on micro-SD card Is there a work around to resolve the playback speed problem ?

NDC-SC avatar Oct 20 '22 10:10 NDC-SC

Can this happen with other equipment?

Tinyu-Zhao avatar Oct 23 '22 16:10 Tinyu-Zhao

Only found the problem with the M5Stack Core2

NDC-SC avatar Oct 23 '22 16:10 NDC-SC

In order to reproduce the problem as soon as possible, you can provide the source code of the problem, you can send it to my email:[email protected]

Tinyu-Zhao avatar Oct 23 '22 16:10 Tinyu-Zhao

sketch emailed

NDC-SC avatar Oct 23 '22 18:10 NDC-SC

Tinyu Zhao: has the reason for the M5Stack Core2 playing MP3 files slowly with M5Core2 0.1.4 or 0.1.5 libraries been determined ?

NDC-SC avatar Oct 29 '22 15:10 NDC-SC

Hi @Tinyu-Zhao, @NDC-SC!

I have the same probelm on M5Stack Core2. I tried with 0.1.5 and 0.1.4 libraries, and with both I have the same error. After I tried with 0.1.3, it work good, the music is normal.

I use that code:

#include <M5Core2.h>
#include <driver/i2s.h>
#include "AudioFileSourceSD.h"
#include "AudioFileSourceID3.h"
#include "AudioGeneratorMP3.h"
#include "AudioOutputI2S.h"

AudioGeneratorMP3 *mp3;
AudioFileSourceSD *file;
AudioOutputI2S *out;
AudioFileSourceID3 *id3;

#define OUTPUT_GAIN 10

void setup()
{
  M5.begin();
  M5.Axp.SetSpkEnable(true);
  file = new AudioFileSourceSD("/test.mp3");
  id3 = new AudioFileSourceID3(file);
  out = new AudioOutputI2S(0, 0);
  out->SetPinout(12, 0, 2);
  out->SetOutputModeMono(true);
  out->SetGain((float)OUTPUT_GAIN/100.0);
  mp3 = new AudioGeneratorMP3();
  mp3->begin(id3, out);
}

void loop()
{
  if (mp3->isRunning()) {
    if (!mp3->loop()) mp3->stop();
  } else {
    delay(1000);
  }
}

peticsizmadia avatar Nov 08 '22 22:11 peticsizmadia

I can confirm that I faced the same issue with the M5Core2 libraries 0.14 and 0.15. It works fine with 0.13 The 0.14/0.15 do have slow mp3 playback (downsampled) no matter if the CPU frequency is changed OR output sampling rate is modified.

aliasgherman avatar Dec 21 '22 11:12 aliasgherman

I am seeing the same issue with streaming also... I will try downgrading the library to 0.13. Yes, that worked. Playback speed back to normal.

Aardvarx55 avatar Mar 10 '23 14:03 Aardvarx55

Same issue with the M5Core2 last version library Works ok with 0.13

I use the same test code as provided by @peticsizmadia

NexusG17 avatar Mar 25 '23 01:03 NexusG17

Thanks, I too have 'downgraded' to 0.13, and will stay with that until I hear the issue is resiolved.

On Sat, 25 Mar 2023 at 01:08, NexusG17 @.***> wrote:

Same issue with the M5Core2 last version library Works ok with 0.13

I use the same test code as provided by @peticsizmadia https://github.com/peticsizmadia

— Reply to this email directly, view it on GitHub https://github.com/m5stack/M5Core2/issues/110#issuecomment-1483650930, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKHUYXTIMUZSWXDEFLMVIP3W5ZAQ3ANCNFSM6AAAAAARJ7QL5Q . You are receiving this because you commented.Message ID: @.***>

Aardvarx55 avatar Mar 25 '23 14:03 Aardvarx55

Hey guys! In the case of newer versions, the speaker must be disabled and the problem will be solved immediately.

M5.begin(true, true, true, true, kMBusModeOutput, false); //begin(bool LCDEnable = true, bool SDEnable = true, bool SerialEnable = true, bool I2CEnable = false, mbus_mode_t mode = kMBusModeOutput, bool SpeakerEnable = true);

zsoltyfm avatar Oct 08 '23 07:10 zsoltyfm

Brilliant. Thanks for resolving the "slow playback speed" problem.

NDC-SC avatar Oct 08 '23 10:10 NDC-SC

Excellent, works a treat... many thanks. I can now use the latest version 0.1.6

Aardvarx55 avatar Oct 08 '23 14:10 Aardvarx55