Help - Search - Members - Calendar
Full Version: Convert PCM Sample
Hydrogenaudio Forums > Hydrogenaudio Forum > Scientific/R&D Discussion
doomtn
Hi all,

My MP3 decoder generates 16-bit PCM sample signed, I want to convert them into 16-bit PCM sample unsigned.

Thanks in advance.
Yirkha
Hi doomtn,

Add 32768 to each sample value.

You are welcome.
doomtn
QUOTE(Yirkha @ Mar 13 2008, 08:24) *

Hi doomtn,

Add 32768 to each sample value.

You are welcome.


Its not working
cabbagerat
QUOTE(doomtn @ Mar 13 2008, 09:10) *

Its not working
Post some code, then. You need to be very careful with signed->unsigned conversions in C (and most other languages, I don't know what you are using).
john33
QUOTE(doomtn @ Mar 13 2008, 12:05) *

Hi all,

My MP3 decoder generates 16-bit PCM sample signed, I want to convert them into 16-bit PCM sample unsigned.

Thanks in advance.

You'll need to move the original value to an unsigned short and then add the 32768. However, why do you want to do it? So far as I'm aware, nothing will play it or know what to do with it.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.