| 238 | } |
| 239 | |
| 240 | static void validateMp3(const fl::vector<fl::u8>& data) { |
| 241 | FL_CHECK_GT(data.size(), 0); |
| 242 | fl::third_party::Mp3HelixDecoder decoder; |
| 243 | FL_CHECK(decoder.init()); |
| 244 | int frames_decoded = 0; |
| 245 | int sample_rate = 0; |
| 246 | decoder.decode(data.data(), data.size(), [&](const fl::third_party::Mp3Frame& frame) { |
| 247 | frames_decoded++; |
| 248 | if (sample_rate == 0) { |
| 249 | sample_rate = frame.sample_rate; |
| 250 | } |
| 251 | }); |
| 252 | FL_CHECK_GT(frames_decoded, 0); |
| 253 | FL_CHECK_GT(sample_rate, 0); |
| 254 | FL_MESSAGE("MP3: " << frames_decoded << " frames, " << sample_rate << " Hz"); |
| 255 | } |
| 256 | |
| 257 | static void validateWebP(const fl::vector<fl::u8>& data) { |
| 258 | if (fl::Jpeg::isSupported()) { |
no test coverage detected