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

◆ begin()

bool fl::third_party::Mp3StreamDecoderImpl::begin ( fl::filebuf_ptr stream)

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

169 {
170 if (!stream) {
171 mErrorMsg = "Invalid stream provided";
172 mHasError = true;
173 return false;
174 }
175
176 mStream = stream;
178 if (!mDecoder->init()) {
179 mErrorMsg = "Failed to initialize MP3 decoder";
180 mHasError = true;
181 mDecoder.reset();
182 return false;
183 }
184
185 mBuffer.resize(BUFFER_SIZE);
186 mBufferPos = 0;
187 mBufferFilled = 0;
188 mBytesProcessed = 0;
189 mHasError = false;
190 mEndOfStream = false;
191 mHasDecodedFirstFrame = false;
192
193 return true;
194}
static constexpr fl::size BUFFER_SIZE
Definition mp3.cpp.hpp:140
fl::unique_ptr< Mp3HelixDecoder > mDecoder
Definition mp3.cpp.hpp:146
fl::enable_if<!fl::is_array< T >::value, unique_ptr< T > >::type make_unique(Args &&... args) FL_NOEXCEPT
Definition unique_ptr.h:261

References BUFFER_SIZE, fl::make_unique(), mBuffer, mBufferFilled, mBufferPos, mBytesProcessed, mDecoder, mEndOfStream, mErrorMsg, mHasDecodedFirstFrame, mHasError, and mStream.

+ Here is the call graph for this function: