Help - Search - Members - Calendar
Full Version: Vorbis plugin for Winamp 1.17
Hydrogenaudio Forums > Hydrogenaudio Forum > Validated News
Wish
The Vorbis decoder for Winamp is out of beta now, get it if you didn't get it previously.

Update: Decoder now supports ReplayGain.

http://www.blorp.com/~peter/zips/wa2update.exe
Somebody
Woohoo, thanks Wish. smile.gif
And thanks PP, of course!
Delirium
Any ideas when/if Winamp is going to include it as part of the default install? I currently stay all-mp3 for the simple reason that I often like sending songs to friends, and most of them are not technically literate enough to do something like manually install a decoder plugin. If they could play oggs with the default Winamp install it'd be much nicer.
Sawg
Last I hard all of wa2update will be in the next Winamp release (including the Vorbis decoder)
Peter
Steve was on #vorbis a few days ago, he's gonna direct AOL freaks to some lawyer guy who checked for all possible legal problems with Vorbis before, so expect things to get moving finally.
whole wa2update thing hasn't been officially approved by Justin, but I consider it 'official' update (because most of that stuff will go to next Winamp setup, including new output plugins which actually have been approved by Justin). if i even can't get Vorbis stuff to Winamp setup, i'll keep both plugins (encoder and decoder) in wa2update; the more people install it, the better - maybe those damn n00bz will start using Winamp to encode oggs instead of making wma shit.
YinYang
Yo Peter.

Now that Garf has implemented Replaygain to Ogg ( http://www.hydrogenaudio.org/forums/showth...s=&threadid=750 and http://www.hydrogenaudio.org/forums/showth...s=&threadid=769 ) do you think you could update the Winamp-plugin to use this?

His source-files should be at

http://sjeng.org/ftp/vorbis/

Pretty please with sugar on top.
Peter
yes, i'll add that soon (doing something else right now)
YinYang
QUOTE
Originally posted by zZzZzZz
yes, i'll add that soon (doing something else right now)


Glad to hear that and thanks smile.gif
ephemeros
Peter, don't want to be obnoxious, but could you be willing to implement the separate decoder - common ReplayGain control panel idea?
Replay Gain: state of play (http://www.hydrogenaudio.org/forums/showth...t=1339#post6110 )

Ah, you can call me obnoxious if you want rolleyes.gif biggrin.gif


--ephemeros
Peter
done (it's very experimental at the moment) - http://www.blorp.com/~peter/zips/in_vorbis_test.exe
common control panel what ? for all formats ? that would require all input plugins to cooperate. not possible in winamp v2.x. (quite possible to do in wa3 i think)
ephemeros
This is doublepost from link I mentioned earlier - but I think it's better to discuss this at abovementioned thread (ReplayGain: state of play):

QUOTE
2. If a player is going to handle Replay Gain properly and consistently across all formats, how should this be done? The obvious answer is to have a single RG control panel, where you can edit the stored values (if needed), set the pre-amp level etc etc. However, at the moment, each format's individual Winamp plug-in is handling the RG adjustment for each format. Hands up who programs with Winamp? How can the plug-ins pass the RG values into a separate RG plug-in which does the processing?


Wouldn't it be better to make the control panel pass it's values (enabled/disabled, pre-amp, ...) to the decoder - like saving in .ini file or something? Decoder support is needed anyway, and I guess quality will be higher. The RG-plugin would only be a common frontend for the different inputs

--ephemeros
YinYang
Oh boy, that was fast. Thanks

Now to go testing

Minor quibble: I hope you will let the user be able choose between using radio or album gain.
Peter
ok, no prob.
btw, i've seen Garf's source; may i ask what's the bloody deal with rc3 ov_read_float problems ? (i'm too lazy to look for answer myself; new in_vorbis uses ov_read_float all time).
Garf
QUOTE
Originally posted by zZzZzZz
ok, no prob.
btw, i've seen Garf's source; may i ask what's the bloody deal with rc3 ov_read_float problems ? (i'm too lazy to look for answer myself; new in_vorbis uses ov_read_float all time).


ov_read_float is a new undocumented function in rc3 (which only you and me are using AFAIK). As you probably have noticed, it's got a weird API. In the normal ov_read, you can specify how many samples you want to get back at most. ov_read_float doesn't allow that, and you have no idea how large a thing you're going to get back. That's a bug (which makes some things more complicated than they should be), and it's going to be fixed in rc4.

CODE


rc3 ov_read_float:



ret = ov_read_float(&vf, &pcm, &iforgotwhatthiswas);



rc4 (and later) ov_read_float:



ret = ov_read_float(&vf, &pcm, max_number_of_samples_you_want, &iforgotwhatthiswas);



If your code can handle the rc3 behaviour, it'll handle the rc4 behaviour too, you'll just have to add a parameter in the calling sequence.

This wasn't discovered until now because nearly noone used ov_read float. I stumbled over it when implementing ReplayGain in XMMS, and Stan Seibert stumbled over it when implementing ReplayGain in ogg123. xiphmont agreed the current behaviour wasn't what was intended, and decided to change it while still not too many people are using it.

As for ReplayGain support in the vorbis plugin:
if you add a switch for Radio vs Audiophile gain, make sure that if Audiophile gain is selected, and no RG_AUDIOPHILE tag is present, you use the RG_RADIO one. You might want to make the switches read Radio/Track Gain and Audiophile/Album Gain for extra clarity.

Also, if it's not too much trouble, add a seperate switch (seperate from the ReplayGain stuff) 'Clipping prevention'

Psuedocode for impelementation:

CODE




if (there_is_a_rg_peak_tag())

  peak = to_float(get_rg_peak_tag());

else

  peak = 0.99;



if (cfg->use_replaygain)

  replaygain = to_float(get_right_tag_here_depending_on_user_settings());

else

  replaygain = 0.0;



scale = pow(10. , replaygain/20);



if (cfg->use_clippingprevention)

{

  if (scale * peak > 1.0)

  {

      scale = 1.0 / peak;

  }

}



Lastly, if you still have time, perhaps make the RG_* tags in the file info window appear a bit nicer, and perhaps allow adjustment of RG_RADIO and RG_AUDIOPHILE (not of RG_PEAK) via a simple spin button or so.

--
GCP
Garf
Pseudocode for a preamp+hard limiter:

(this really should have been in the WinAmp native preamp btw smile.gif)

assuming sample is a float with 1.0 being full scale (the stuff you get out of ov_read_float) and is already ReplayGain-processed

CODE


if (vorbis_cfg.use_hq_preamp)

{

  sample *= pow(10., preamp_db/20);

   

 /* hard 6dB limiting */

 if (sample < -0.5)

              sample = tanh((sample + 0.5) / (1-0.5)) * (1-0.5) - 0.5;

  else if (sample > 0.5)

             sample = tanh((sample - 0.5) / (1-0.5)) * (1-0.5) + 0.5;

}    



Since a) it makes the player slower because of the arithmetic and b) many people will not want the limiter, this should also be a toggelable switch.

preamp_db should be a slider from -12dB to 12dB or so.

--
GCP
Peter
ok, thanks for info.
http://www.blorp.com/~peter/zips/in_vorbis_test.exe - still a test version; if you find any problems - report them here.
YinYang
Beautiful, simply beautiful

Such a great plugin, such teamwork, such fast progression, such a great idea, such respectfullnes, such helpfulness, such such such....
...
...
*sniff* I'm overwhelmed.
(And obviously losing it) wink.gif

Thanks a bundle.
Peter
just finished porting stuff to wa3. yay. too bad i'm using wa3 sdk which works only with 'leet' internal builds (you will probably have to wait for wa3 beta3 before you can see any binaries).
the fun part is - vorbis wa3 plugin now outputs floats, then a new component (float->pcm converter) converts them to regular PCM (16/24/32bit) and applies replaygain / preamp stuff (optionally with hard limiter, which kicks major ass); any input plugin can produce 32/64bit floats now, add RG_* tags, then my component will handle the rest. hell, it will be even possible to make a "replaygain control panel" which looks much more sweet than the image on replaygain.org, hehehe.
Lear
ReplayGain and the new Winamp Vorbis plugin seems to work just fine on my W2K system (on the few files I've tested it on, using album gain). Thanks guys (Garf and PP)!

I only miss one thing: an option in ReplayGain to not re-calculate the gain if the tags are present. Then I can use my simple bat file to re-scan a bunch of folder and only process the new stuff. smile.gif
Garf
QUOTE
Originally posted by Lear
I only miss one thing: an option in ReplayGain to not re-calculate the gain if the tags are present. Then I can use my simple bat file to re-scan a bunch of folder and only process the new stuff. smile.gif


Okay, I'll add this.

--
GCP
Wizard
Can someone please explain to me what a hard limiter does? ohmy.gif
Garf
QUOTE
Originally posted by Wizard
Can someone please explain to me what a hard limiter does? ohmy.gif


If you try to increase the amplitude of a digital signal too much, there is a chance it will go outside the range that you can represent. Because you really can't go outside that range, all samples which are outside it will have the same, maximal value. This is known as 'clipping'. For an example, turn the standard WinAmp preamp to +20dB and listen to the result. The sound will have some heavy crackling and very bad quality.

What a hard limiter does is dynamically compressing the digital signal, so that it will never go outside of that range. A graph shows better what happens:

[img]0daf5fec93[/img]

Y-axis are output sample values, X-axis is input

As you can see, the part up until from -0.5 to 0.5 is a straight line. No compression happens, the input sample value is mapped directly to the output sample value without anything changing. But as soon as you go higher the values start getting reduced but they are still monotonically rising. If the input value gets bigger and bigger (or smaller and smaller) the ouput starts curving and approaches -1/1 asymptotically, but never reaches it ('cos that would be clipping).

I hope this makes things clearer, as I'm not very good at making things simple sometimes :-/

--
GCP
CiTay
QUOTE
Originally posted by Wizard
Can someone please explain to me what a hard limiter does? ohmy.gif


A hard limiter is a compressor. It reduces gain above a given threshold of loudness, limiting all peaks above the threshold to the threshold level. So the high volume parts would get limited, and the low volume parts can be louder. This way you can avoid clipping, and still get the maximum possible loudness for the song, a technique which is, in some variations, widely used in radio and TV broadcast.

The louder you can make a song sound on the radio, the more attention you will get with it. It's the reason why most "singles" are optimized for maximum loudness, whereas the albums are sometimes more carefully produced.
Garf
Done.

Option '-q' won't analyze files that have ReplayGain tags in them.

http://sjeng.org/ftp/vorbis/replaygain.exe

or

http://sjeng.org/ftp/vorbis/ReplayGain-0.8.tar.gz

Edit: There were a few bugs. Files have been updated.

--
GCP
Wizard
Garf and CiTay, thank you very much for such a detailed explanation smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.