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: imad imadero
Subject: [Octave-bug-tracker] [bug #56889] Incorrect encoding results from uint8 vector to wav file
Date: Sat, 14 Sep 2019 17:03:54 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36

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

the problem with audiowrite function is that it do not encode 0,253,254,255
values as uint8() to the wav file.
to verify this I propose the following code:

% test audiowrite function for uint8 vector
Fs=8000;
f="test.wav";
y=[];
for k=1:32
  y(k)=256-k; %%%%% last 32 bytes in the field 2^8.
endfor
audiowrite(f,uint8(y),Fs,'BitsPerSample',8);% values 255,254,253 could not be
writen into the file !!!!
audioread(f,'native') %% check results written to the file


note: the code above works well on Matlab thus encoding all uint8 valuse
including 0,253,254 and 255.

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message posté via Savannah
  https://savannah.gnu.org/




reply via email to

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