Jan Kiszka wrote: > +static void audio_fill_mixer_buffer(mv88w8618_audio_state *s, unsigned int length) > +{ > + unsigned int pos; > + double val; > + > + if (s->mute) { > + memset(s->mixer_buffer, 0, length); > + return; > + } > + > + if (s->playback_mode & 1) > + for (pos = 0; pos < length; pos += 2) { > + val = *(int16_t *)(s->target_buffer + s->play_pos + pos); > + val = le16_to_cpu(val) * pow(10.0, s->volume/20.0); > + *(int16_t *)(s->mixer_buffer + pos) = val; > + } This variant "sounds" better: for (pos = 0; pos < length; pos += 2) { uint16_t tmp = *(uint16_t *) (s->target_buffer + s->play_pos + pos); val = (int16_t)le16_to_cpu(tmp); val = val * pow(10.0, s->volume/20.0); *(int16_t *)(s->mixer_buffer + pos) = val; } Find latest patches at http://home.arcor.de/jan.kiszka/patches/QEMU/ Jan