[vorbis] Getting started with vorbisfile_example.c (MS VC 6)

Alan MacDonald newslists at warpzillion.com
Thu Jun 27 16:55:13 PDT 2002



That's a great idea, the whole problem really stems from the fact that there
is no fopen() call in the examples, just the lesser known WIN32 _setmode
calls,  which I think people either don't recognize what they are doing or
think that setting to binary mode only applies to stdin or stdout...

On a side note, Monty, both q 0 and 64kb/s managed bitrate in the RC4 CVS
tree sound awesome (for the amount of bits being used). Great work!

Later,
Alan

> -----Original Message-----
> From: owner-vorbis at xiph.org [mailto:owner-vorbis at xiph.org]On Behalf Of
> Monty
> Sent: Thursday, June 27, 2002 5:28 PM
> To: vorbis at xiph.org
> Subject: Re: [vorbis] Getting started with vorbisfile_example.c (MS VC
> 6)
>
>
>
>
>
> On Thu, Jun 27, 2002 at 10:52:32AM -0400, Alan MacDonald wrote:
> >
> >
> > > -----Original Message-----
> > > From: owner-vorbis at xiph.org [mailto:owner-vorbis at xiph.org]On Behalf Of
> > > Michael Smith
> > > Sent: Thursday, June 27, 2002 10:38 AM
> > > To: vorbis at xiph.org
> > > Subject: Re: [vorbis] Getting started with vorbisfile_example.c (MS VC
> > > 6)
> > >
> > > >file * myfile;
> > > >myfile = fopen("C:\downloads\music.ogg","r");
> > >
> > > This is an incredibly stupid 'feature' of DOS and windows.
> Use "rb" for
> > > the file open mode, or reading the file does not give you the file
> > > contents.
> > >
> >
> > What makes it even more confusing is, what you are reading will
> mostly look
> > correct, except the carriage returns and line feeds are
> translated to DOS
> > mode with 'r'.  'rb' disables that translation.  Maybe it might
> be worth it
> > to add a comment to the example files on how to use fopen in
> windows, even
> > though the examples use stdio and stdout, since this seems to
> come up often.
>
> Actually, there's no reason not to have the example just use "rb".
> ANSI stdio will always take the 'b' happily, it just won't do anything on
> UNIX.
>
> I'll be beefing up the example programs a bit for 1.0, and I'll add
> this minor but important nigglet to the list.
>
> Monty

<p>--- >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-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 mailing list