Re: Wav to Ogg Vorbis conversion
Erik de Castro Lopo <[email protected]> Fri, 11 Mar 2011 09:02:59 +1100
| Newsgroups | gmane.comp.multimedia.ogg.vorbis.devel |
|---|---|
| Organization | Erik Conspiracy Secret Labs |
| Message-ID | <[email protected]> |
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/