[vorbis-dev] Decoding with 8 bit-samples

Michael Smith msmith at xiph.org
Mon Apr 12 19:07:40 PDT 2004



On Tuesday 13 April 2004 00:59, Crock Real wrote:
> Hi!
>
> I'd like to make a stereo 8-bit wav file
> from a stereo (16 bit) ogg vorbis file
> (in delphi, with the vorbisfile).
>
> I use:
>
>     ret := ov_open_callbacks(filein,vf,nil,0,ops_callbacks);
>     if ret = 0 Then
>     begin
>       fileOut :=  TFileStream.Create(savedlg.FileName,fmCreate);
>       repeat
>         ret := ov_read(VF, pcmout, BufferSize, 0, 1, 1, nil); //'cause of
> the 8-bit fileOut.Write(pcmout,ret);
>       until ret = 0;
>     end;
>
> The result will be cracking.... etc (will be unrecognizable). Why?
> If I decode into 16-bit samples, everything is ok!

8 bit audio is usually unsigned, you're decoding as signed. That's probably 
your problem.

Mike

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list