[Vorbis-dev] ogg123 volume?

Graham Mitchell graham
Wed Jun 16 21:05:33 PDT 2004


> I need to adjust the output volume from ogg123 the same way that
> mpg123 has the "-f n  change scalefactor [32768]" option.

Well, back in the day, I was thinking about adding replaygain support to
ogg123 (though someone has since beat me to it), and here's what I was told
by Stan Seibert on irc:

* You'll be editing oggvorbis_format.c:ovf_read()

* Use ov_read_float() instead of ov_read() so you can do your scaling before
you quantize.

* Oh, and I swiped the loops from vorbisfile.c in the vorbis libraries to
convert the floats to integers.

* It is okay to modify (in your case, scale all the samples) directly in the
float buffer ov_read_float() gives you.

* For some reason, I thought I had to copy the floats out before I could
multiply.

These tips were over my head then, and they still are, but hopefully they're
helpful.

And be careful what you say on IRC, volsung.  Some folks like myself keep
logs of important tidbits.  :)

--
Graham Mitchell - computer science teacher, Leander High School
"It is a great mistake to think that God is chiefly interested in religion."
-- William Temple



More information about the Vorbis-dev mailing list