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

MP3 files play with "slow" speed #110

Closed
NDC-SC opened this issue Oct 20, 2022 · 13 comments
Closed

MP3 files play with "slow" speed #110

NDC-SC opened this issue Oct 20, 2022 · 13 comments

Comments

@NDC-SC
Copy link

NDC-SC commented Oct 20, 2022

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 ?

@Tinyu-Zhao
Copy link
Collaborator

Can this happen with other equipment?

@NDC-SC
Copy link
Author

NDC-SC commented Oct 23, 2022

Only found the problem with the M5Stack Core2

@Tinyu-Zhao
Copy link
Collaborator

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:Tinyu.Zhao@gmail.com

@NDC-SC
Copy link
Author

NDC-SC commented Oct 23, 2022

sketch emailed

@NDC-SC
Copy link
Author

NDC-SC commented Oct 29, 2022

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 ?

@peticsizmadia
Copy link

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);
  }
}

@aliasgherman
Copy link

aliasgherman commented Dec 21, 2022

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.

@Aardvarx55
Copy link

Aardvarx55 commented Mar 10, 2023

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.

@NexusG17
Copy link

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

I use the same test code as provided by @peticsizmadia

@Aardvarx55
Copy link

Aardvarx55 commented Mar 25, 2023 via email

@zsoltyfm
Copy link

zsoltyfm commented Oct 8, 2023

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);

@NDC-SC
Copy link
Author

NDC-SC commented Oct 8, 2023

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

@Aardvarx55
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants