Sound and mixing channels question

From: Mats (spamenot.mog.pettersson_at_telia.com)
Date: 02/29/04


Date: Sun, 29 Feb 2004 01:02:33 GMT

Hi!

I just started looking in to programming a sound app. These days it
seems that most apps that i found source for on internet mixes multiple
sound channels (in a music app like soundtracker) with software instead
on relying on that the soundcard supports multiple channels.

My question is though if say, you have a one byte per sample (or 8 bit
per sample if you like) buffer and mixes say two channels into that
buffer, the code i've seen just adds the two channels, but what happens
if one or several bytes overflow? The output of say 240+128 is 368 which
would set the mixed byte to 368-256=112?!? Wouldn't this distort the sound?

If anyone could point out somekind of tutorial or examples of how this
should be handled i would be very greatful. :)

Mackan

-- 
Remove all before "mog" to reply by email.


Relevant Pages

  • Re: 5.1 IN HDTV.
    ... about surround sound is difficult to understand. ... independent channels, the only real solution is digital audio. ... speakers behind the screen. ...
    (rec.arts.movies.production.sound)
  • Re: 5.1 IN HDTV.
    ... about LFE. ... > about surround sound is difficult to understand. ... > independent channels, the only real solution is digital audio. ...
    (rec.arts.movies.production.sound)
  • sound card doesnt work
    ... My sound card doesn't play any sound. ... Sound card appears to only support 2 channels. ... Audio Controller supports 6 channels. ...
    (comp.os.linux.misc)
  • sound card doesnt work
    ... My sound card doesn't play any sound. ... Sound card appears to only support 2 channels. ... Audio Controller supports 6 channels. ...
    (comp.os.linux.hardware)
  • Re: How to do Alsa configuration (asoundrc) on-the-run while an application is running?
    ... asoundrc file to change the volume level on the channels while the ... /dev/sound/mixer controls the channels on a particular sound device. ... most people can't even listen to 2 songs ...
    (comp.os.linux.misc)