FastLED 3.9.15
Loading...
Searching...
No Matches

◆ init()

bool fl::third_party::Mp3HelixDecoder::init ( )

Definition at line 27 of file mp3.cpp.hpp.

27 {
28 if (mDecoder) {
29 return true; // Already initialized
30 }
31
32 // Initialize Helix decoder
34 if (!mDecoder) {
35 return false;
36 }
37
38 // Allocate PCM buffer
39 mPcmBuffer.reset(new fl::i16[MAX_PCM_SAMPLES]); // ok bare allocation (array new)
40 if (!mPcmBuffer) {
41 MP3FreeDecoder(static_cast<HMP3Decoder>(mDecoder));
42 mDecoder = nullptr;
43 return false;
44 }
45
46 return true;
47}
fl::unique_ptr< fl::i16[]> mPcmBuffer
Definition mp3.h:117
void * HMP3Decoder
Definition mp3dec.h:88
void MP3FreeDecoder(HMP3Decoder hMP3Decoder) FL_NOEXCEPT
Definition mp3dec.hpp:93
HMP3Decoder MP3InitDecoder(void) FL_NOEXCEPT
Definition mp3dec.hpp:72
constexpr fl::size MAX_PCM_SAMPLES
Definition mp3.cpp.hpp:15

References fl::third_party::MAX_PCM_SAMPLES, mDecoder, fl::third_party::MP3FreeDecoder(), fl::third_party::MP3InitDecoder(), and mPcmBuffer.

Referenced by fl::Mp3::parseMp3Info().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: