+ int i;
+ float val;
+ if (width == 4) // 32bit float
+ {
+ float *snd_out = (float*)rb_ptr;
+ if (nchannels == 8) // 7.1 surround
+ {
+ for (i = 0; i < nbframes; i++, painted_ptr++)
+ {
+ *snd_out++ = painted_ptr->sample[0];
+ *snd_out++ = painted_ptr->sample[1];
+ *snd_out++ = painted_ptr->sample[2];
+ *snd_out++ = painted_ptr->sample[3];
+ *snd_out++ = painted_ptr->sample[4];
+ *snd_out++ = painted_ptr->sample[5];
+ *snd_out++ = painted_ptr->sample[6];
+ *snd_out++ = painted_ptr->sample[7];
+ }
+ }
+ else if (nchannels == 6) // 5.1 surround
+ {
+ for (i = 0; i < nbframes; i++, painted_ptr++)
+ {
+ *snd_out++ = painted_ptr->sample[0];
+ *snd_out++ = painted_ptr->sample[1];
+ *snd_out++ = painted_ptr->sample[2];
+ *snd_out++ = painted_ptr->sample[3];
+ *snd_out++ = painted_ptr->sample[4];
+ *snd_out++ = painted_ptr->sample[5];
+ }
+ }
+ else if (nchannels == 4) // 4.0 surround
+ {
+ for (i = 0; i < nbframes; i++, painted_ptr++)
+ {
+ *snd_out++ = painted_ptr->sample[0];
+ *snd_out++ = painted_ptr->sample[1];
+ *snd_out++ = painted_ptr->sample[2];
+ *snd_out++ = painted_ptr->sample[3];
+ }
+ }
+ else if (nchannels == 2) // 2.0 stereo
+ {
+ for (i = 0; i < nbframes; i++, painted_ptr++)
+ {
+ *snd_out++ = painted_ptr->sample[0];
+ *snd_out++ = painted_ptr->sample[1];
+ }
+ }
+ else if (nchannels == 1) // 1.0 mono
+ {
+ for (i = 0; i < nbframes; i++, painted_ptr++)
+ {
+ *snd_out++ = painted_ptr->sample[0];
+ }
+ }