Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / PCM 16 bit signed vs PCM 8 bit unsigned music format

Author
Message
Hangar18
17
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 24th Jul 2009 09:17 Edited at: 24th Jul 2009 09:17
Hi All,

Discovering the wonders of modifying human voices (via Goldwave) in a DBC space game but in terms of outputing am unsure which format to use. The default save option is a wav (PCM, 16 bit signed, stereo) but this takes up twice as much space as a wav (PCM, 8 bit unsigned, stereo). In terms of quality I cannot notice any real differece so the question I have is whether the 8 bit format is likely to cause a problem on some systems compared to the 16 bit. Or indeed if there are any other reasons why the 16 bit format is preferable/essential over the the 8 bit?

Thanks.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 24th Jul 2009 12:12
I don't know what the distinction between signed and unsigned are in this case in relation to the sound. However, the bit depth of a digital sound is basically the amplitude resolution. A digital sound is made up of small parts called samples. A sample is an amplitude, the height of a wave, if you will, at a given point in time. The greater the bitdepth, the more samples you can fit within a given time, thus the more sound information.

As a sound is recorded, the samples are created linearly over time; each sample being a volume at that specific time based on a sample rate (like 44100 cycles per second for example). The sound takes on the shape of a wave. The pitch(es) is(are) determined by how many of these waves are created within the sample rate. So back to bit depth.

A wave has a low point and a high point that have an inverse relationship. This is why signed and unsigned confuses me in terms of sound because a wave will have a + side at the top and a - side at the bottom. So a bit depth of 16 allows a total number of possible sample positions of 65535. If 0 is the middle, that means + 32768 and -32767 . So that would be signed 16 bit I suppose. 8 bit would have a much lower resolution: 0 to 255 which would translate to +128 and -127.

Now stereo just runs two waves simultaneously on two channels. The bit resolution is the same on each channel, it's just the samples can be a little different to create panning, spaciousness, or even completely different tracks.

If you have short sounds - like gun fire, or you have a low rumbling like in a cavern, 8 bit would suffice if you don't have to hear distinct quality. If you have speaking, unless it is through a radio or telephone, 16 bit would serve better for maximum clarity.

As far as stereo, if you want to use 3d sounds in DBC, they have to be monophonic. I can only see using true stereo for music, and maybe some grand sounds here and there. But using mono and the 3d effects should work quite well and is half the file size.

Also, instead of or in addition to changing the bit depth, try changing the sample rate before you save the sound. 16 bit at 22050 is hard to distinguish from 16 bit at 44100 and it still will have better sample resolution than 8 bit at 44100. I keep mentioning 44100 because that is the standard sample rate for a CD.

The sound will be different if you use a compressed format like mp3, but the underlying principals still apply.

Enjoy your day.
Hangar18
17
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 27th Jul 2009 03:22
Wow, thanks Latch - where on earth do you acquire all this amazing knowledge?
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 28th Jul 2009 00:02
Quote: "Wow, thanks Latch - where on earth do you acquire all this amazing knowledge"

Thanks! Maybe it's all Wrong!!

Really, trying to do stuff in DarkBASIC has lead me to read up on whatever I was trying to do. And I've poked around at music here and there in the past.

Enjoy your day.

Login to post a reply

Server time is: 2024-05-20 05:16:45
Your offset time is: 2024-05-20 05:16:45