Hydrogenaudio Forums

Lossless Audio Compression => WavPack => Topic started by: HA-User on 2020-06-28 00:31:25

Title: wvgain
Post by: HA-User on 2020-06-28 00:31:25
hi, i havent been on this site for awhile.  but back when i was getting eac set up, someone helped me a lot in getting my wavpack command line, which is

-w "Artist=%artist%" -w "Title=%title%"   -w "Album=%albumtitle%" -w "Year=%year%" -w "Track=%tracknr%/%numtracks%" -w "Album Artist=%albumartist%"  -w "Disc=%cdnumber%/%totalcds%" -w "Genre=%genre%" -w "Composer=%composer%" -w "Performer=%albuminterpret%"  %hascover%--write-binary-tag "Cover Art (Front)=@%coverfile%"%hascover% --allow-huge-tags  -hh %source% %dest%

i dont remember most of it - LOL

i have recently found out that they are customizing ipod classics, and putting as much as 2 terabytes of flash memory on it, such that i think i could load all my rips into wavpack, and listen to them directly, foregoing the mp3 stage altogether.  the person i am buying the ipods from tells me that he needs to install rockbox on the ipod, sort of replacing the apple firmware, in order to listen to the wavpack files.

i have currently been using mp3gain on all my mp3s that i load into itunes, so i can have all of my songs at somewhat the same loudness.  my research tells me that wavpack files can be loaded with replaygain notation, such that the same thing will happen.

i am of the understanding that all i have to do is add some gain nomenclature to the above command line, for all my future eac rips ?

can someone tell me what that new command is ?
Title: Re: wvgain
Post by: bryant on 2020-06-28 02:01:13
Haha, interesting, an iPod with 2TB! I actually have a 4th gen classic iPod with Rockbox and it works great.

Unfortunately there's no way to calculate and include the ReplayGain info during the rip. However, it's easy to do afterwards. You could use Foobar2000 to do it. Or you could, as you mention, use the wvgain program to do one folder (album) at a time. Just go into the folder and enter:
Code: [Select]
wvgain -a *.wv

One thing about Rockbox is that I don't think it handles embedded cover art in WavPack files (not sure why) so you need to include a cover.jpg file in the directory, and it needs to be a non-interleaved jpg (I ran into this recently). Of course, if your iPod doesn't have a color display then covers don't look that great anyway.
Title: Re: wvgain
Post by: HA-User on 2020-06-28 03:56:58
hi bryant,

thanks for the reply.  i do remember your name, so you may be the one that helped me in the past ?

i dont quite understand what to do with the cover art, but it is not that important to me.  i am almost never looking at the ipod, when i am listening to music.  and i very, very seldom listen to an album.  i make lots of playlists, but many of them are just alphabetical lists of the songs.  some times i will listen to an artist.  but generally i just like to listen to a varied group of songs.

i have never used the wvgain program, although i suppose i could learn it well enough to put in the command !!

but i am familiar with foobar.  all the stuff that i have ripped are stored by artist, and then by album.  i am guessing i click on "file", and either add files or add folder.

i dont see any button for gain ?

i did add an mp3, and went to properties.  it shows me a track gain of -2.41 db on that particular song.  but i dont see any particular way of having foobar figure out how much gain each song should have ?
Title: Re: wvgain
Post by: HA-User on 2020-06-28 05:03:52
i figured it out.  after i have the files selected in foobar, i right click on it

go to replay gain

my goal is to have all songs on the ipod have similar loudness levels

so am i correct in thinking that i would choose "scan per file track gain" ?
Title: Re: wvgain
Post by: HA-User on 2020-06-28 06:22:45
it was easy to click on a folder.  about 50 songs in the sample.  it did not take long for the scan to run.

but i dont know what the target goal was ?  and some of the songs were reduced by 10 db

with mp3gain, you could key in a target rate.  the default is 89.  but i would usually go to 92.  and i think many of the mp3s had increased volumes.

if a song showed clipping, i might rescan that one down a bit.  and there were certainly times that i scanned up on songs, as well - if they were too soft.

i am concerned that i might not get enough volume during playback, if i am gonna have 10 db cut.  isnt that a substantially large reduction ?
Title: Re: wvgain
Post by: kode54 on 2020-06-28 06:33:51
Not if that file is substantially loud, as such a reduction implies.
Title: Re: wvgain
Post by: HA-User on 2020-06-28 15:18:28
well, the songs that were being reduced the most, were the loudest.

so i think it is doing a good job, in terms of equalizing

i would like to go higher than 89, if possible

there is little clipping at 92

and not sure i would notice it, if there is some ?
Title: Re: wvgain
Post by: bryant on 2020-06-28 19:28:16
Players will generally give you what's called a "preamp" option so that you can boost the level past the 89 dB point. Both Foobar2000 and Rockbox have this.

They will also give you the option to reduce the gain if clipping will occur (which is why the "peak" value is stored in there).
Title: Re: wvgain
Post by: HA-User on 2020-06-28 23:12:23
hi bryant,

that sounds perfect.  rockbox itself will allow me to boost the level, during play ?

okay, then i will use foobar to equalize everything for me, and then boost it accordingly, depending on what i find

the equalization was even more important than the boost, but getting both is great

that is a very good solution !!
Title: Re: wvgain
Post by: HA-User on 2020-06-28 23:13:30
is my math correct ?

when checking my wavpack files, they seem to average about 1.5 mb.

2 terabytes is 2 million mb ?

that is 1.3 million songs ?
Title: Re: wvgain
Post by: bryant on 2020-06-29 04:43:14
The part that doesn't sound right is the 1.5 mb per track. Assuming a 4 minute track of 44/16/2 audio with 33% compression I calculate about 28 mb per track. That would be about 70,000 tracks. And since you probably can't use the whole 2TB, etc., assume 50,000 tracks.

I'm not sure how well the database would work with that many tracks, so you might run into other issues. But I don't think you'll run out of HD space. I actually think 1TB would be enough for most collections. That's about 2500 albums assuming around 400 mb each.
Title: Re: wvgain
Post by: HA-User on 2020-06-29 05:35:17
okay, sounds good.  i doubt if i will end up with more than 50,000 songs.  it is not my intention to have it loaded with every song on every album. 

i only want the songs that i like.  i will keep all my songs on terabyte drives.  but on my ipod, i will have a lot of songs, but certainly not all of them.

i dont think i will have a problem with the data base.  right now i have all my songs on alphabetical playlists (the mp3s).  i plan to do a somewhat similar thing on this new ipod classic.

i can now see that i will die of old age before i ever get the ipod filled up !!

but i prefer not to have go thru all the mp3 and itunes situation

just have all these wavpack files in various playlists, and then simply copy a playlist from my computer to my ipod.

btw, the average length of one of my songs is probably about 2 1/2 minutes.  i like rock, pop and country from the 50s and 60s, some 70s. 

most of those songs dont make the 3-minute mark

thanks for all your help

i wasted $125 on a used 7th generation ipod.  but in return, i got all this good info from various people, and will end up with an almost perfect system for myself.

so i guess it turned into a pretty good investment !!!!!
Title: Re: wvgain
Post by: HA-User on 2020-06-29 23:08:41
hi bryant,

i was off by a factor of 10.  a song that lasts 2:40 is exactly 15,561 kb.  that translates to 15.561 mb

if we transpose those numbers for a 4-minute song, it would come out to 23.31 mb

that is reasonably close to the 28 that you calculated

my only guess is that my version of wavpack is compacting it a little more than the 33% figure that you used ?
Title: Re: wvgain
Post by: bryant on 2020-06-30 04:04:58
The compression you get with lossless varies a lot with the source. Some loud metal might compress only 20% or less, while some quiet acoustic can quite often compress over 50%, and I've seen classical go over 65%. Volume is the biggest contributor.

I use 33% as a generally obtainable average, but it's quite often better than that. The differences between different lossless compressors or different settings will be smaller than the differences between different tracks or types of music.
Title: Re: wvgain
Post by: HA-User on 2020-06-30 04:46:32
that explains it.  you already know the type of music i listen to.  whether it is country, pop, or rock - it is nothing at all like heavy metal.  after listening to your explanation, i highly suspect a high percentage of my songs are gonna compress somewhat equally.

i dont want to take the time to recalculate it, but i am guessing that i am near about 40%, which is good to know.

by that, i assume that if a wav file takes up 10mb, and i am compressing 40%, my wavpack file would end up at 6 mb ?
Title: Re: wvgain
Post by: bryant on 2020-06-30 19:56:04
by that, i assume that if a wav file takes up 10mb, and i am compressing 40%, my wavpack file would end up at 6 mb ?
Yes. Sometimes there's some confusion about this because people say something is compressed to 40%, which would mean a 10 mb file would end up 4 mb. FLAC reports this as a ratio (e.g., 0.4000).

Whereas when I say compressed 40% I mean that the file gets 40% smaller (or 6 mb). I prefer this description because bigger numbers mean better compression.
Title: Re: wvgain
Post by: HA-User on 2020-07-01 00:55:29
i did quite a bit of research on flac and wavpack, before i started doing any lossless compression.  i chose wavpack, but i no longer recall what my reasons were.  i do like the fact that i can store tags in them, unlike the wav file.
Title: Re: wvgain
Post by: HA-User on 2020-07-01 14:05:00
hi david,  i had absolutely no idea that you are the creator of wavpack !!  i stumbled upon it, while looking it up on the wiki.

in one article it says that wavpack is the combination of a high quality lossy file, and a correction file - that when combined together, gives a lossless file

there was also a time when rockbox only worked on the lossy file

do you know if rockbox currently reproduces its sound from the full wavpack lossless FILES, or does it still only play the lossy portion ?

the person i am buying from (i will be happy to send you a link, if desired) is selling iPod Classic 7th Generation Digital Media Players
Title: Re: wvgain
Post by: bryant on 2020-07-01 16:15:42
Haha, yeah, that's me!  :)

Rockbox does not play the correction file, it still only plays the lossy file.

There actually is a portable player that plays the correction file, however. (https://hydrogenaud.io/index.php?topic=119143.msg982580#msg982580)

But to be clear, that is a special WavPack mode called "hybrid" and I don't think you're using that. The default is regular 1-file lossless and you have to specify certain options to get the 2-file hybrid mode. The correction file is actually a separate file for every track with a .wvc extension. You don't have those, right?
Title: Re: wvgain
Post by: HA-User on 2020-07-01 16:55:21
when i do my compression, i end up with just 1 .wv file

are you saying that this wv file is a lossless file, all by itself ?

that is what i thought, until i read about wavpack creating 2 files

Title: Re: wvgain
Post by: bryant on 2020-07-01 17:30:24
If you have a single .wv file then it is probably lossless, unless you tried to produce something else.

The easiest way to tell is with Foobar2000 --> Properties on the file. It should show lossless somewhere.

When WavPack creates two files, you'll see the other one with the .wvc extension. It's not buried in the other file or anything like that.
Title: Re: wvgain
Post by: HA-User on 2020-07-01 23:30:18
sample rate = 44,100 hz

channels = 2

bits per sample = 16

bit rate = 812 kbps

codec = wavpack

codec profile = wavpack high

encoding = lossless

tag type = apev2

embedded cuesheet = no
Title: Re: wvgain
Post by: HA-User on 2020-07-06 07:13:31
hi david,

a couple of interesting points

1) i looked at my rips folder, where all my wv files are.  currently i have 15,437 files, taking up 234gb.  if you figure that is about 1/4 of a terabyte, then each terabyte would contain about 60,000 songs

2) i have the song "my boyfriend's back" as the full-length version, and the single version.  the full-length version lasts 2:36, and takes up 18,634 kb.  the single version lasts 2:13, and only takes up 8,803 kb.  i know you said different songs, and different types of songs can take up differing amounts of storage.  but this is the same song.  any idea why there would be such a discrepancy ??
Title: Re: wvgain
Post by: m14u on 2020-07-06 15:35:04
are both version is 16/44100?
Title: Re: wvgain
Post by: HA-User on 2020-07-06 16:28:11
i just looked at the properties in foobar

they are both 16/2/44100

but the bitrate (whatever that is) is substantially different, which i am guessing is the reason

the long version is 977.  the single version is only 539.

this is not of my doing.  i use eac to rip all my files, and use the exact same instructions.
Title: Re: wvgain
Post by: bryant on 2020-07-06 20:04:11
The bitrate on the long version sounds reasonable, but the bitrate on the shorter version is suspiciously low, which is why it's so small.

I can think of three possible reasons. One is that while the file is stereo, it might actually be identical (or almost identical) in the two channels. You should be able to tell if you listen in headphones. Do the two tracks sound pretty similar?

Another possibility is that the level is significantly lower in the shorter sample. This should be easy to see by looking at the replaygain values.

Finally, the shorter file may have LSB redundancy. This means that a lot of bits are zero that shouldn't be and so the file is much more compressible. I don't know why that would be, but it's possible, and it could sound the same (there's a clever program called lossyWAV that takes advantage of this).

I suppose that the larger one could have something making it harder to compress like high-frequency noise, but that's less likely.

If you're really curious you could make the files available to me (maybe just the shorter one) and I could tell you exacly.
Title: Re: wvgain
Post by: HA-User on 2020-07-07 00:26:25
i guess i would be interested in knowing.  i am not sure i would be a good judge at how similar the channels are.

the only way i know how to send a file, is to attach it in an email

i tried to do a copy and paste here on this forum, but nothing showed up
Title: Re: wvgain
Post by: HA-User on 2020-07-07 00:38:44
hi david,

i did a search on the net for your email, and it did give me one.  so i sent you an email, titled "my boyfriend's back"

if you dont get it, you can let me know.  i did not think it was appropriate to mention your email on the forum, without your permission.

most of the songs do seem to be closer to the 15-20mb.  almost none of them are as small as 8-9.
Title: Re: wvgain
Post by: bryant on 2020-07-07 01:35:22
I got the file, thanks! And you're probably right that many people wouldn't like their e-mail plastered in a forum because web crawlers will find them, although the wavpack e-mail is pretty much public at this point.

And you're not supposed to post any audio file longer than 30 seconds, so that might be why you couldn't.

Anyway, the single version is actually almost perfect mono, which is why it compresses so good. The single version sounds like everything is coming right from the middle, but the full length version has stuff panned hard left and right. If you listen for that it should be pretty obvious.
Title: Re: wvgain
Post by: HA-User on 2020-07-07 01:54:33
okay, i see.  that makes sense, as well.

the single version was made shorter to get lots of airplay on the radio

so no reason to make it stereophonic
Title: Re: wvgain
Post by: HA-User on 2020-07-07 02:31:54
it got me wondering - just when did stereo become popular.  research says that it became somewhat widely available for homes in 1958.  but i guess that would be for records and record players.  not too many radios were stereophonic.

and they were still learning.  i recall the first beatle stereo lps would have all the singing come out of 1 channel and all the music come out of the other channel.  i am sure that sounds ridiculous, today.  i thought it was ridiculous back then.  my ears cant stand that.  i would much rather hear straight mono.  on my stereo receiver back then, there was a knob in which you could listen to the source in mono - probably for that exact reason - when a stereo mix just wasnt any good !!

i think my ears are fairly common.  because i do not like to hear unbalanced singing.  and most recordings seem to keep the singing fairly equal between the channels, so that it sounds like it is coming right from the middle of your head.

i think the main advantage to stereo is it is easier to pick up on all the various instruments, if they balance it so that each instrument seems to come from a slightly different location

it is not uncommon for me to listen to a song in stereo, and hear something for the first time - an instrument that probably gets drowned out in a fully mono recording.

i dont notice these things nearly as much as you might, because by far and away, my biggest love of music is the melody.  my brain zeroes in on that, and puts most everything else a bit on the back burner.

i also know that there has been a lot of tinkering around with old recordings, when they started putting them on cds.  they made good stereo outputs of the beatles, as well as a lot of other older recordings.
SimplePortal 1.0.0 RC1 © 2008-2020