Article View: borland.public.cppbuilder.multimedia
Article #385Re: zero value with samples
From: Mark Jacobs
Date: Tue, 26 Oct 2004 09:08
Date: Tue, 26 Oct 2004 09:08
23 lines
2206 bytes
2206 bytes
Thanks Tom. That formula certainly works on all PC systems I've ever tried it on! Example apps using 8-bit unsigned samples are in VU meters at http://www.jacobsm.com/index.htm#sft - look at MJ Player and MJ Calculator. -- Mark Jacobs "Tom|420" <tom420.duhamel@gmail.com> wrote in message news:417db647$1@newsgroups.borland.com... | Fraser Ross wrote: | | > "Mark Jacobs" | >>This is what I use for 8-bit samples :- | >>int lv=(int)((unsigned char)wvhdr->lpData[0])-128; | > | > That isn't an answer to my question. BTW I don't think the cast to int is | > necessary. | > My former suggestion of 128 positive values and 128 negative values and | > using 0 as if it is the midpoint seems to be the norm. | | Mark Jacobs answer is the only good answer to your question. If you | don't trust that answer do some research (although you will probably | find that audio experts don't publish much free stuff on the net -- | actualy they don't even publish much for-a-fee stuff anywhere).
Technical Details
Message-ID:
<417e1440@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!transit.nntp.hccnet.nl!newsfeed.wirehub.nl!194.72.7.126.MISMATCH!news-peer-test!btnet!newsfeed.bt.es!195.5.65.34.MISMATCH!caladan.arrakis.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<4166532e@newsgroups.borland.com> <4167c2a9@newsgroups.borland.com> <4167e397@newsgroups.borland.com> <417db647$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10d0fc,c5ac5258fa1a1e59 X-Google-Attributes: gid10d0fc,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Mark Jacobs" <http://www.jacobsm.com/mjmsg.htm?Borland%20Newsgroup> Newsgroups: borland.public.cppbuilder.multimedia References: <4166532e@newsgroups.borland.com> <4167c2a9@newsgroups.borland.com> <4167e397@newsgroups.borland.com> <417db647$1@newsgroups.borland.com> Subject: Re: zero value with samples Date: Tue, 26 Oct 2004 10:08:53 +0100 Lines: 24 Organization: DK Computing MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 81.86.186.94 Message-ID: <417e1440@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1098781760 81.86.186.94 (26 Oct 2004 02:09:20 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!transit.nntp.hccnet.nl!newsfeed.wirehub.nl!194.72.7.126.MISMATCH!news-peer-test!btnet!newsfeed.bt.es!195.5.65.34.MISMATCH!caladan.arrakis.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail