Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: ReplayGain with radio stations? (Read 12956 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

ReplayGain with radio stations?

Does ReplayGain work with radio stations? E.g. 50 radio stations in a playlist, each station shall have the same loudness?
Win 7, Win Vista, newest stable foobar & EAC & Cue-Tools

ReplayGain with radio stations?

Reply #1
Obviously not, because RG requires analysing an entire file/stream before adjusting its volume accordingly, something that is not possible with real-time streams of effectively infinite length.

ReplayGain with radio stations?

Reply #2
Thank you.

Might there work another method to automatically get (nearly) the same loudness of radio stations?
Win 7, Win Vista, newest stable foobar & EAC & Cue-Tools

ReplayGain with radio stations?

Reply #3
I think you would need a dynamics compressor/limiter that additionally attempts to hover around a single loudness at all times. Unfortunately, I’m not aware of the latest solutions for this, but hopefully someone else can suggest one!

ReplayGain with radio stations?

Reply #4
OK, I assume, that could or would be an add on / extension / component for foobar. I mean to have seen a compressor and / or limiter somewhere in "Components".
Win 7, Win Vista, newest stable foobar & EAC & Cue-Tools

ReplayGain with radio stations?

Reply #5
I think foo_dsp_effect has a compressor.
It's only audiophile if it's inconvenient.

ReplayGain with radio stations?

Reply #6
Many thanks for the link, Kohlrabi.

In "Playback", "DSP Manager" I can find a Dynamics Compressor and a EBU R128 Compressor, so what can I do now with them?

Win 7, Win Vista, newest stable foobar & EAC & Cue-Tools

ReplayGain with radio stations?

Reply #7
I was hoping to save the streams in a playlist file and somehow apply ReplayGain manually to that, as many stations would have a fairly consistent volume level. That didn't work, which is a shame, and there's not a database of RG values stored in fb2k these days, as far as I'm aware.

I tried the EBU R128 Compressor on a couple of streams and first of all I thought it made no difference, which actually means my personal Pre-Amp was just about right, so here's your first option!

OPTION 1
I've set my ReplayGain Pre-Amp to 0.0 dB and Apply Album Gain, and for sources without Replay Gain (which means radio streams only, most of the time), I have it set to -7.5 dB.

This method ensures no additional dynamic range compression is applied and gets the volume about the same as my music collection. However, unusually quiet or loud stations would still seem out-of-whack.

OPTION 2
The EBU R128 Compressor (from the R128Norm1.11 DSP) goes into your DSP chain and will automatically match to the ReplayGain standard 89 dB SPL using the R-128 algorithm and a reasonable look-ahead.

I played a stream from http://icecast-beta.timlradio.co.uk:8000/ac96.opus (not all Absolute Radio Opus streams are always on air, however) which was fairly loud and that tamed it by about 7.5 dB and it sounded fine, as did http://radioserver1.delfa.net/64.opus (which seems to be a reliably available stream)

(Actually, I didn't notice the DSP working at first when I put it in and removed it from my DSP list until I set my Pre-Amp back to 0.0 dB or down to -20.0 dB, when it became obvious)


Beyond those options, the standard compressor (at default setttings) isn't so much of an automatic volume control as Option 2 - e.g. if I set my PreAmp to -20 or +11 dB, it produces quite different volume, whereas EBU R128 Compressor does a nice job of maintaining consistency (without overdoing it when volume fades below the 'gate' level)

The Smoothest Jazz streams at http://radioserver1.delfa.net/64.opus (and the barely distinguishable http://radioserver1.delfa.net/256.opus at four-times the bitrate) seem to maintain a nice dynamic range and the EBU R128 Norm DSP doesn't noticeably affect it.

In fact, it does such a subtle job, it might be my ideal choice for pre-processing background music to a consistent volume without introducing so many steps in the process (I've used vlevel DSP with ReplayGain post-processing before, and achieved easier consistency with just ToneBoosters TB Compressor more recently, but this seems to be aiming at exactly my type of use case - barely affect the sound quality but keep the volume nicely consistent).
Dynamic – the artist formerly known as DickD

ReplayGain with radio stations?

Reply #8
Many thanks for testing and explaining.

So, all I have to do is to use option 2 - as it is the better one - and to just add the EBU R128 Compressor to "Active DSPs" and since there is not anything to adjust, that it was. It seems to work on my system, also as far as I can see, like you say, great, and so easily done.

I see, the "Dynamics Compressor" takes effect instantly after adding, also.

The Smooth Jazz station is very good, I was looking for exactly such music stations. Where did you find it?

Many thanks again.
Win 7, Win Vista, newest stable foobar & EAC & Cue-Tools

ReplayGain with radio stations?

Reply #9
Thanks for those hints Dynamic. I was using your option 1, but option 2 looks more family-safe. So is vlevel, but I don't always want that.

EDIT: I think I can hear the effect of the EBU R128 Compressor kicking in sometimes. Also, it delays the start of playback for radio stations (presumably it is buffering several seconds, which the radio stream delivers in something like real time).

Cheers,
David.

ReplayGain with radio stations?

Reply #10
The Smooth Jazz station is very good, I was looking for exactly such music stations. Where did you find it?


Great isn't it. I did notice a smooth jazz style christmas song in there last week, though! Someone else mentioned it in a thread about converting a captured stream into a valid Ogg/Opus file with correct duration and starting time display. I then traced the URL through google found the Icecast Directory at http://dir.xiph.org/, which mentions Opus64, Opus256 and MP3192CBR versions of the station (note that Opus isn't specifically mentioned in the Icecast Directory's codec options, but it uses an Ogg container, so comes up as Vorbis). I hadn't really noticed the Icecast Directory before, but it's good.

Thanks for those hints Dynamic. I was using your option 1, but option 2 looks more family-safe. So is vlevel, but I don't always want that.

EDIT: I think I can hear the effect of the EBU R128 Compressor kicking in sometimes. Also, it delays the start of playback for radio stations (presumably it is buffering several seconds, which the radio stream delivers in something like real time).


Yup, I noticed the delay when applying it, especially when playing the very immediate Opus streams, so it must have a reasonable look-ahead.

I didn't hear many unwanted artifacts of the EBU R128 Compressor. I think I've heard subtle compression effects too, though - mainly just a little noise modulation when moving from quiet intros or moving into quiet fade outs that originated from low SNR analogue media but used a wide dynamic range. So far I've not noticed any pumping, but it did a FAR better job than vlevel at the intro of Since You Been Gone by Rainbow in avoiding a noticeable dip on the guitar part as the look ahead sees the full band is about to start much louder. For me this beats vlevel.

In my experience of making quiet background music since about 2007, vlevel alone would just occasionally get it way wrong for volume - my distinct memory is that Robbie Williams' Millennium in particular was far too loud after just vlevel, and a couple of songs got lost slightly so I switched to using vlevel on conversion to an intermediate FLAC then ReplayGain scanned that FLAC (original ReplayGain 1 algorithm - that has been invaluable to me over the years, David!) and applied that gain before sending it to the helix MP3 encoder (somewhat quicker than older LAME versions for a large batch job with no gapless support and matching quality at about 131kbps). So clearly, any loudness-contour aware compressor (Fletcher-Munson effect or similar) aiming for consistent loudness should do better. The TB Compressor (from Toneboosters) also seems to do better than vlevel with the settings I adopted (and I left the top end of that fairly uncompressed for clean transients).

On a fairly quick appraisal EBU R128 Compressor seemed maintain consistent medium and long term volume, but has plenty of headroom and leaves transients nice and crisp* unlike many fast compressor/limiters that can deaden a lot of the drums and sharp percussion on older (non clippressed) material (which is why I went for vlevel originally as a simple gain rider with modest peak limiting).

(* I should say I didn't give it full detailed headphone listening or ABX anything - I was mainly interested in low and medium volume performance and ensuring it didn't sound lifeless)

When giving it the once over, apart from those radio streams, I definitely jumped straight for a few tracks I knew to have been extreme cases. Since You Been Gone which had been poor on vlevel was well handled, Aretha Franklin's beautiful high dynamic range cover of Tracks Of My Tears from Aretha Arrives was also brought out nicely without getting lost in the first half when I turned down the listening volume (vlevel also did very well when I originally used it), and I'm pretty sure I ran it past Millennium to ensure it was properly loudness-aware, and it didn't jump out as too loud. (I probably had Album Gain and -7.5dB preamp for everything non-RG turned on the whole time I put it through its paces, but my selection included quiet album tracks brought up and loud ones brought down). The main thing I didn't really test was modern clippressed ultraloud tunes played without any kind of negative gain applied before it reached the EBU R128 Compressor.

I'm pretty happy with it for quiet background music purposes and moderately loud listening where there's noise around and I'll forego the full dynamic range.

I use different Windows User Accounts with different audio settings (where they're independently adjustable) and different fb2k settings (e.g. -3 dB RG pre-amp to give a bit more headroom for dynamic effects on the User Account I use for editing backing tracks), so for one of these where I mostly work and listen to music casually it might make sense to run the EBU R128 Compressor most of the time, if I start using radio streams with disparate volume targets quite often.
Dynamic – the artist formerly known as DickD

ReplayGain with radio stations?

Reply #11
Update:  Just tried EBU R128 Compressor on a live digital mixer direct to USB recording from the other night, and there were a couple of areas where its effects were noticeable - especially as the plain instrumental sections in Wichita Lineman came in. We had the vocals rather prominent so the backing rose fairly noticeably when they came to an end and there was no pause between beats there to disguise the gain ramp. There were also some rather over-prominent intros which sounded a bit odd to me being so familiar with their dynamics.

Then again, for a quick quality check, verification of very low noise levels and to see whether crowd applause and banter were picked up adequately to survive an edit it was very helpful and its effect was largely transparent (in the loose non TOS#8 sense that any AGC or Compressor can be transparent and with the few exceptions noted). It's also useful for skipping through rapidly and casually noting down appropriate cue points for later editing after the entire fade out without listening at high volume.
Dynamic – the artist formerly known as DickD

ReplayGain with radio stations?

Reply #12
Thanks for sharing your experience Dynamic.

I heard vlevel let something through too loud, but assumed that was because I'd turned the strength down to 0.6, and then 0.7, to try to tame it a bit. It is helpful to hear from someone who has listened for longer and tried harder with it!

Cheers,
David.


ReplayGain with radio stations?

Reply #14
I thought it worth quoting the following post in this thread too (the post itself references this thread), as it's probably to best solution for automatically using R128 Compressor only for radio that I've seen:

With thanks to WilB for the useful post quoted below
and massive kudos to popatr for the foo_dynamicdsp plugin (copy the dll from the Release folder in the zip into your fb2k components) that lets you specify using titleformatting syntax which chain of additional DSPs you'd like to use (your syntax should return the text of the chain's name or a null string for no chain).

Since my media files are already replay gained, I find this plug-in useful for loading the EBU R128 Compressor and applying replay gain on the fly selectively for radio streams so that all radio streams and media library tracks are of similar sound level.

The EBU R128 Compressor automatically matches to the ReplayGain standard 89 dB using the standard R-128 algorithm and a reasonable look-ahead. I use a titleformat script of $if($strstr(%path%,'://'),Radio,). The Radio chain contains the EBU R128 Compressor. See also http://www.hydrogenaudio.org/forums/index....=0&p=823073

I just tested WilB's method and was able to adjust the Preferences/Playback pre-amp for non-ReplayGained sources over a 40 dB range (using Apply and waiting for the buffer) with no effect on the output level exactly as

It's quite possible to be more specific with the titleformatting string if your situation is different (e.g. if you access ReplayGained files via a full URL containing :// you could instead search to see if either of the ReplayGain gain tags is present and otherwise use the Radio DSP chain)

I thought I could improve matters further, so I tested the following as a Custom column in playlist view, and it correctly identified my main library tracks as ReplayGain, but put the text R128Compressor next to all tracks without ReplayGain (including the Windows 7 sample tracks in C:\Users\Public\Music\Sample Music), plus Radio URLs and a couple of test files)
$if($or($strstr(%replaygain_album_gain%,' dB'),$strstr(%replaygain_track_gain%,' dB')),ReplayGain,R128Compressor)

This did catch files with only a track gain and no album gain too.

Thus, I went ahead and tested my version in Dynamic DSP:
Code: [Select]
$if($or($strstr(%replaygain_album_gain%,' dB'),$strstr(%replaygain_track_gain%,' dB')),,R128Comp)

I then set up the Chain called R128Comp to contain just the EBU R128 Compressor DSP from mudlord's foo_dsp_effects bundle kode54.

This screenshot shows the dialogue boxes and still shows my test column indicating whether ReplayGain or the R128 Compressor should be used with each file.



The only very minor downside is that where the EBU_R128 compressor is used it adds a few seconds look-ahead buffering time before playing the Opus format radio stream which is otherwise low latency and barely buffered at all. On file-based playback without RG

I don't think there's any reason you couldn't use multiple instances and multiple chains to choose numerous effects where it makes more sense than building numerous similar but different chains. In one or two instances, I might in fact identify some hard-panned stereo files with a comment in their tags and apply some crossfeed DSP to those alone, or conversely detect the word binaural and bypass the crossfeed when I wish to use it by default.
Dynamic – the artist formerly known as DickD

ReplayGain with radio stations?

Reply #15
Was there any reason for using the EBU R128 Compressor DSP from mudlord's foo_dsp_effects bundle as opposed to the kode54 version ( http://www.foobar2000.org/components/view/foo_r128norm ) - or are they the same?

ReplayGain with radio stations?

Reply #16
Completely different compressors. The compressor in foo_dsp_effect is not even based on EBU R-128. It is a pure dynamics compressor.

foo_r128norm, on the other hand, is more of a short range R128 gain filter, scanning 10 seconds ahead and always buffering at least 4 seconds of sample data, to attempt to be the closest to using the player's own ReplayGain scanner on a full track.

ReplayGain with radio stations?

Reply #17
@kode54. Thanks for the clarification. I am getting on very well using your plug-in with radio streams. I wondered if you had considered making the plug-in inert if a track already has replay gain, i.e. do absolutely nothing with such tracks. Currently it does seem to process tracks with replay gain, e.g. changing the preamp doesn't alter the volume if r128norm is present and so there appears to be a double effect due to the intrinsic replay gain and the r128norm plug-in. I think making the plug-in inactive for tracks with replay gain may make the plug-in more generally useful because it can then be left in the dsp chain and automatically kick in with radio streams or tracks lacking replay gain (assuming there are no unwanted side effects).

ReplayGain with radio stations?

Reply #18
Oops!

Thanks, WilB, for asking about kode54's plugin and making me check my memory. Actually, having installed that and mudlord's DSP_effect bundle about the same time, I'd forgotten where I obtained the EBU R128 Compressor - in the DSP list it's not so obvious which Component plugin they're from and I simply misremembered. Actually, ealier in this very thread I mentioned the right one.

Actually, as you can see from the screenshot, I WAS using kode54's excellent EBU R128 Compressor - thank you kode54 - not the standard compressor from mudlord's bundle. The R128 Compressor has the unique advantage of matching perceptual loudness with ReplayGain.

I don't think I can edit my previous post, near the screenshot where I mentioned the wrong Component.
Dynamic – the artist formerly known as DickD

ReplayGain with radio stations?

Reply #19
That Dynamic DSP component should work just fine. The only recommendation I can give is that when you use an instance of it, you place the dynamic DSP which hosts it at the very top of the DSP chain. That way, when it enables or disables itself, it won't be forcing any other DSPs to flush themselves.

That's the thing about requiring track change markers from a DSP component. It forces the core to flush every track completely before sending the track change notification. If you have any resampler or similar DSP filters before your notified DSP, they will be forced to flush their output first, which could create noticeable gaps in the encoding.

Of course, I guess if you're going to be using a DSP like this with its approximation of track gain on every file, gaplessness won't be much of a concern.

ReplayGain with radio stations?

Reply #20
Good point, and thanks for that. I've now put the Dynamic DSP which may or may not call the EBU R128 Compressor first in my main chain, and my resampler second in the chain.

As it happens, the resampler as I've set it usually does nothing (under my normal Windows User Account it's set to only resample rates that are unsupported on my DisplayPort->HDMI connection to my LG TV to 48000) so won't resample 44.1 or 48kHz anyhow, and those two rates account for the vast majority of my tracks, whether commercial, self-recorded or streamed.

For my gapless collection, it's all ReplayGained, so that should play fine and radio streams are continuous and gapless anyway, but I tested it with a mixed playlist of ReplayGain and non-ReplayGain tracks alternating, followed by the Smoothest Jazz streaming radio URL, and it seems all tracks ran continuously without pause (even the Radio stream at the end of the playlist buffered enough into the EBU R128 Compressor to start immediately the previous track ended).
Dynamic – the artist formerly known as DickD