Re: ALSA: arecord : silennce recorded as 0x80

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 13, 2023 at 3:50 PM Muni Sekhar <munisekharrms@xxxxxxxxx> wrote:
>
> Hi all,
>
> I recorded the silence on the default audio card by running "arecord
> -d 5 test.wav."
>
> Once it exited, I checked the contents by running "hexdump test.wav,"
> and I see that silence is recorded as a sequence of 0x80 instead of
> 0x00.
>
> 0000000 4952 4646 0024 8000 4157 4556 6d66 2074
> 0000010 0010 0000 0001 0001 1f40 0000 1f40 0000
> 0000020 0001 0008 6164 6174 0000 8000 8080 8080
> 0000030 8080 8080 8080 8080 8080 8080 8080 8080
> 0000040 8080 8080 8080 8080 8080 8080 8080 8080
> ...
>
> What might be the reason for silence being recorded as 0x80 instead of
0x0?
>
>
> --
> Thanks,
> Sekhar

This is what I found after Googling a bit:
Since you didn't specify a format, arecord defaults to 8 bit format (U8).
Being unsigned, a negative value for maximum negative amplitude is
impossible. Therefore the value is given a bias of 128,
making 0 the maximum negative amplitude, 255 the maximum positive, and 128
the center point (or silence).

Best Regards,
Luke




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux