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

◆ stb_vorbis_get_samples_float()

int32_t fl::third_party::vorbis::stb_vorbis_get_samples_float ( stb_vorbis * f,
int32_t channels,
float ** buffer,
int32_t num_samples )

Definition at line 5218 of file stb_vorbis.cpp.hpp.

5219 {
5220 float **outputs;
5221 int32_t n=0;
5222 int32_t z = f->channels;
5223 if (z > channels) z = channels;
5224 while (n < num_samples) {
5225 int32_t i;
5227 if (n+k >= num_samples) k = num_samples - n;
5228 if (k) {
5229 for (i=0; i < z; ++i)
5230 memcpy(buffer[i]+n, f->channel_buffers[i]+f->channel_buffer_start, sizeof(float)*k);
5231 for ( ; i < channels; ++i)
5232 memset(buffer[i]+n, 0, sizeof(float) * k);
5233 }
5234 n += k;
5235 f->channel_buffer_start += k;
5236 if (n == num_samples)
5237 break;
5238 if (!stb_vorbis_get_frame_float(f, nullptr, &outputs))
5239 break;
5240 }
5241 return n;
5242}
uint32_t z[NUM_LAYERS]
Definition Fire2023.h:93
void * memcpy(void *dest, const void *src, size_t n) FL_NOEXCEPT
void * memset(void *s, int c, size_t n) FL_NOEXCEPT
int32_t stb_vorbis_get_frame_float(stb_vorbis *f, int32_t *channels, float ***output) FL_NOEXCEPT
float * channel_buffers[FL_STB_VORBIS_MAX_CHANNELS]
fl::i32 int32_t
Definition coder.h:220

References FL_NOEXCEPT, memcpy(), memset(), stb_vorbis_get_frame_float(), and z.

+ Here is the call graph for this function: