Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problems with 8 bit audio from SampleGrabber

8 views
Skip to first unread message

Felix Collins

unread,
Nov 18, 2009, 5:26:11 PM11/18/09
to
Hi,
I'm implementing an audio meter using SampleGrabber (yet another
one!). It seems to work fine for 16 bit samples but when I set the
audio source to capture as 8bit the data from sample grabber does not
appear to be correct. I should note that recording in 8 bit works
fine and the recording is perfectly audible. From what I understand
of PCM each 8bit value should represent a number between -128 and 127.
The problem is that when there is very little sound on the mic the
data in the buffer memory from pBuffer in the BufferCB function looks
like this:

80 80 80 80 80 80 80 80 80 80 80 80 00 00 80 00 54 04 54 04 7a 01 0b
01 78 c1 d5 09 74 22 00 00 74 22 00 00 08 f3 3c 00 03 00 00 00 00 00
00 00 00 00 00 00 18 b2 28 07 81 81 80 80 80 80 80 80 80 80 7e 7e 7c
7c 7f 7f 81 81 7f 7f 7c 7c 7b 7b 7f 7f 83 83 84 84 81 81 80 80 80 80
81 81 81 81 80 80 7f 7f 7f 7f 7e 7e 7e 7e 80 80 80 80 80 80 7f 7f 80
80 81 81 81 81 7f 7f 7f 7f 80 80 7e 7e 7a 7a 7c 7c 80 80 7f 7f 7c 7c
7e 7e 81 81 81 81 7f 7f 80 80 80 80 80 80 81 81 80 80 7f 7f 81 81 83
83 81 81 7d 7d 7c 7c 7d 7d 7e 7e 7f 7f 7e 7e 7e 7e 80 80 83 83 82 82
7f 7f 82 82 85 85 83 83 81 81 83 83 83 83 81 81 7f 7f 7e 7e 7f 7f 7e
7e 7c 7c 7c 7c 7e 7e 80 80 7e 7e 7d 7d 7d 7d 7e 7e

When there is a lot of sound on the mic (whistling into it for
example) then it looks like this:

36 36 2d 2d 23 23 19 19 11 11 0b 0b 0b 0b 0d 0d 0d 0d 0c 0c 0d 0d 0c
0c 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0e 0e 0d 0d 0e 0e 0e 0e 0e 0e 0e 0e
0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f
0f 0f 0f 0f 0f 12 12 24 24 6b 6b e4 e4 ff ff f0 f0 ff ff fe fe fc fc
ff ff fc fc ff ff fd fd ff ff fe fe ff ff fe fe ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff fb fb e8 e8 bf
bf 9d 9d 9e 9e 93 93 6f 6f 41 41 07 07 00 00 0f 0f 0c 0c 08 08 0d 0d
0b 0b 0a 0a 0e 0e 09 09 0e 0e 09 09 0e 0e 0a 0a 0d 0d 0b 0b 0d 0d 0c
0c 0d 0d 12 12 2c 2c 6b 6b b8 b8 eb eb ff ff ff ff fb fb ff ff fd fd
fe fe ff ff fe fe ff ff fe fe ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

Does anyone have any idea about what is going on or how to interpret
this data? To me it looks as though the data had 0x80 as 0 Volts, 0xff
as +max Volts and 0x00 as -max Volts. The 16 bit data does not follow
this pattern though.

Thanks for any help on this. Does anyone have a reference as to what
the PCM data passed through directshow actually represents?

Cheers,
Felix

0 new messages