loaded = 0;
for (i = 0; i < pmd->synth.pcm.length; i++) {
int sample = MAD_TO_SHORT(pmd->synth.pcm.samples[0][i]);
write_int16_host_endian(outbuffer + loaded, sample);
loaded += 2;
loaded = 0;
for (i = 0; i < pmd->synth.pcm.length; i++) {
int sample = MAD_TO_SHORT(pmd->synth.pcm.samples[0][i]);
write_int16_host_endian(outbuffer + loaded, sample);
loaded += 2;