Re: Wav to Ogg Vorbis conversion
"Dmitriy Reznik" <[email protected]> Fri, 11 Mar 2011 08:01:47 -0500
| Newsgroups | gmane.comp.multimedia.ogg.vorbis.devel |
|---|---|
| Message-ID | <[email protected]> |
Dear Erik, Thank you for your answer. It looks way simpler than what I was trying to do. Could you please answer a few of my questions? 1) Can I add libsndfile to my MFC project, and if yes, how? Because I need to be able to distribute the software in one executable. 2) I have to convert to ogg vorbis not .wav files, but raw wave data stored in multiple BYTE (unsigned char) arrays. Could you please tell me how the code should look then? I want all that data to be converted into one .ogg file. Thank you so much, Dmitriy -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Erik de Castro Lopo Sent: Thursday, March 10, 2011 5:03 PM To: [email protected] Subject: Re: [Vorbis-dev] Wav to Ogg Vorbis conversion Dmitriy Reznik wrote: > I am trying to use an example I found here: > > http://svn.xiph.org/trunk/vorbis/examples/encoder_example.c If all you want to do is to write data to an Ogg/Vorbis file, you might have a look at libsndfile: http://www.mega-nerd.com/libsndfile/ Writing an Ogg/Vorbis file with libsndfile looks like: SNDFILE *file ; SF_INFO info ; memset (&info, 0, sizeof (info)) ; info.format = SF_FORMAT_OGG | SF_FORMAT_VORBIS ; info.channels = 2 ; info.samplerate = 44100 ; if ((file = sf_open (filename, SFM_WRITE, &info)) == NULL) handle_error () ; sf_writef_float (file, data, frames) ; sf_close (file) ; Hope this helps. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/ _______________________________________________ Vorbis-dev mailing list [email protected] http://lists.xiph.org/mailman/listinfo/vorbis-dev