mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-12 22:47:15 +03:00
Bell catchup
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
#include "AudioContainers.h"
|
||||
|
||||
#include <string.h> // for memcmp
|
||||
#include <cstddef> // for byte
|
||||
#include <string.h> // for memcmp
|
||||
#include <cstddef> // for byte
|
||||
#include "BellLogger.h" // for BellLogger
|
||||
|
||||
#include "AACContainer.h" // for AACContainer
|
||||
#include "CodecType.h" // for bell
|
||||
#include "MP3Container.h" // for MP3Container
|
||||
#include "ADTSContainer.h" // for AACContainer
|
||||
#include "CodecType.h" // for bell
|
||||
#include "MP3Container.h" // for MP3Container
|
||||
|
||||
namespace bell {
|
||||
class AudioContainer;
|
||||
@@ -20,15 +21,19 @@ std::unique_ptr<bell::AudioContainer> AudioContainers::guessAudioContainer(
|
||||
|
||||
if (memcmp(tmp, "\xFF\xF1", 2) == 0 || memcmp(tmp, "\xFF\xF9", 2) == 0) {
|
||||
// AAC found
|
||||
std::cout << "AAC" << std::endl;
|
||||
return std::make_unique<bell::AACContainer>(istr);
|
||||
BELL_LOG(info, "AudioContainers",
|
||||
"Mime guesser found AAC in ADTS format, creating ADTSContainer");
|
||||
return std::make_unique<bell::ADTSContainer>(istr, tmp);
|
||||
} else if (memcmp(tmp, "\xFF\xFB", 2) == 0 ||
|
||||
memcmp(tmp, "\x49\x44\x33", 3) == 0) {
|
||||
// MP3 Found
|
||||
std::cout << "MP3" << std::endl;
|
||||
BELL_LOG(info, "AudioContainers",
|
||||
"Mime guesser found MP3 format, creating MP3Container");
|
||||
|
||||
return std::make_unique<bell::MP3Container>(istr);
|
||||
return std::make_unique<bell::MP3Container>(istr, tmp);
|
||||
}
|
||||
|
||||
BELL_LOG(error, "AudioContainers",
|
||||
"Mime guesser found no supported format [%X, %X]", tmp[0], tmp[1]);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user