octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #56889] Incorrect encoding results from uint8


From: Rik
Subject: [Octave-bug-tracker] [bug #56889] Incorrect encoding results from uint8 vector to wav file
Date: Sun, 15 Sep 2019 10:56:06 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #9, bug #56889 (project octave):

Could you re-upload test.matlab.wav?  It is identical to test.octave.wav and
does not show the characteristic "FF FF FF" that is captured in your screen
shot of the binary editor.

Also, could you run this test in Matlab and upload the file?


audiowrite ('tst.matlab.uint8.wav', uint8 ([0, 1, 2, 253, 254, 255]), 8000,
'BitsPerSample', 8)


When I try this with Octave and look at the resulting binary I see [1, 2, 3,
252, 253, 254].  In other words, audiowrite() seems to be compressing the
range [0, 255] in to the range [1,254].  I verified that if I write 0:255 to a
wav file I get 256 elements, but the range is [1, 254] and there are duplicate
values.

There is also a problem with audioread.  I directly modified the binary test
file used above to have values [0x00 0x01 0x02 0xFD 0xFE 0xFF].  When this is
read with audioread the result is [0, 1, 2, 251, 252, 253].

The C++ source file for both functions is in libinterp/dldfcn/audioread.cc.



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56889>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]