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 Professional Discussion / is there a way to use 16 bit signed integers in dbpro?

Author
Message
MayoZebraHat 1979
18
Years of Service
User Offline
Joined: 21st Dec 2007
Location:
Posted: 22nd Apr 2010 04:36
It would be handy for wave file data processing for 16 bit sample rates.
ShaunRW
DBPro Developer
18
Years of Service
User Offline
Joined: 7th Jan 2008
Location: Brisbane, Australia
Posted: 22nd Apr 2010 05:23
I think a WORD is 16bit, I'm not sure though.

Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 22nd Apr 2010 12:05
Quote: "I think a WORD is 16bit, I'm not sure though."

It is, but it's unsigned.

For wave data, words work just fine.
Just imagine it ranging from 0 to 65535, 32768 being the (silent) middle.
Or just convert the words to signed integers like so;
signed = word - 32768
Should use twice the memory though, given that you store the information that way. Calculating it on the fly as you go would probably slow down processing a tad instead.

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Apr 2010 15:28
Actually, it's:


Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 22nd Apr 2010 16:10
Lol, I blame it on just getting out of bed

Login to post a reply

Server time is: 2026-07-26 07:36:19
Your offset time is: 2026-07-26 07:36:19