[ogg-dev] format question

Arc arc at Xiph.org
Wed May 11 07:19:26 PDT 2005


On Wed, May 11, 2005 at 04:09:15PM +0200, Frans Haarman wrote:
> Hi,
> 
> I am thinking about making a small tool.  After reading about patents 
> and mp3 I choose another format. OGG seems best.

Cool.  Welcome to the club, then.  One note, however, Ogg is a word, not 
an acronym, so it's Ogg not OGG.
 
> I was wondering if I can edit the OGG files and adjust the volume, to 
> create a Fade-in and Fade-out. The tool I need makes
> configurable timed fade-ins and fade-outs of the volume of my OGG files.

Yes, with a bit of page/packet wrangling and possibly transcoding.  For 
volume adjustment there are "VorbisGain" tags which will allow you to 
adjust the volume of an entire stream.

If you want, you can chop the front and tail of a stream (as long as you 
don't need to mix the audio) and use steps of VorbisGain to do fade 
effects.  Any page can be easily "chopped" into a seperate stream, just 
need to copy the header pages and make it a seperate serialno.

For mixing, or for a more smooth fade effect, you'll need to chop the 
data off in pages, decode the chopped data, do your mixing, and then 
re-encode as a seperate stream.

Chain it all together and you have a complete fade effect.  There 
/could/ be a codec to do this without all this extra work, but such an 
"effects codec" would only work on supported players.

> And if someone knows good python libaries for OGG I would like to hear 
> about those as well.

py-ogg (1) is incomplete.  You can do some things with it, but not 
others.  py-vorbis works with it and gives you decode support.

There are "boost" Python bindings, I have not used them.

py-ogg2 only works with libogg2 but is very complete.  Because there is 
heavy development with libogg2 at current it may be out of sync with the 
current source, but I can help you find a stable combination of py-ogg2 
and libogg2.  It does not have any codec support yet, with the goal of 
using OggStream to access any Ogg codec.  

I am the author of py-ogg2 and developed it for exactly the kind of work 
described above.  I have used it in the past along with py-shout to do 
some majorly cool mojo, mixing live and playlist content from multiple 
sources (different geographic locations) on-the-fly and sending it to an 
Icecast2 server.  

Pretty soon it'll be possible to do the same with video, which is 
something I'm very excited about.



-- 

Diversity is the Fuel of Evolution, 
 Conformity it's Starvation.
Be Radical.  Be New.  Be Different. 
Feed Evolution with Everything You Are.


More information about the ogg-dev mailing list