Help - Search - Members - Calendar
Full Version: MPC ReplayGain questions/request
Hydrogenaudio Forums > Lossy Audio Compression > MPC
Garf
Is there any way to have MPC ReplayGain automatically traverse a directory tree, and automatically calculate both album and track gain (upon the assumption that each album is in a seperate dir), and skip the already replaygained/non-mpc files?

i.e. I'd like to do

replaygain --smart --recurse --album --skip c:music*.mp+

The Vorbis ReplayGain tool already allows this...I'd like it for MPC too.

BTW. What K setting do I need to make MPC ReplayGained files sound as loud as Vorbis ReplayGained files?

--
GCP
Case
QUOTE
Originally posted by Garf
BTW. What K setting do I need to make MPC ReplayGained files sound as loud as Vorbis ReplayGained files?

K-14.
Case
QUOTE
Originally posted by Garf
Is there any way to have MPC ReplayGain automatically traverse a directory tree, and automatically calculate both album and track gain (upon the assumption that each album is in a seperate dir), and skip the already replaygained/non-mpc files?

I checked the sources and it should work when you don't specify extensions. But when I tried it by giving directory name (it had to end to ) it didn't work recursively. When running from the directory with options --auto --smart it crashed. I'll see if I can make it work.
Lear
QUOTE
Originally posted by Garf
Is there any way to have MPC ReplayGain automatically traverse a directory tree, and automatically calculate both album and track gain (upon the assumption that each album is in a seperate dir), and skip the already replaygained/non-mpc files?

i.e. I'd like to do

replaygain --smart --recurse --album --skip c:music*.mp+

The Vorbis ReplayGain tool already allows this...I'd like it for MPC too.


Well, the source for both programs are available, so it should be a fairly quick hack. Replacing the functions has_tags(), get_gain() and write_gains() should do the trick. The rest of the code is very generic, I think.

Hm... Shouldn't be too hard to include support Vorbis, MPC, MP3 and Wav in the same executable, with only fairly small changes to the existing code. smile.gif
YinYang
QUOTE
Originally posted by Lear

Hm... Shouldn't be too hard to include support Vorbis, MPC, MP3 and Wav in the same executable, with only fairly small changes to the existing code. smile.gif


Now THIS sounds VERY promising. That would be perfect smile.gif
Case
QUOTE
Originally posted by Garf
Is there any way to have MPC ReplayGain automatically traverse a directory tree, and automatically calculate both album and track gain (upon the assumption that each album is in a seperate dir), and skip the already replaygained/non-mpc files?

Actually now that I studied this thing better it is possible with current replaygain. The command to do this is

replaygain --smart --auto c:music
Frank Klemm
QUOTE
Originally posted by Case

Actually now that I studied this thing better it is possible with current replaygain. The command to do this is

replaygain --smart --auto c:music


--smart should not be used. The idea behind --smart was
to speed up indexing by skipping always processed file.
This makes trouble with album settings.
Lear
QUOTE
Originally posted by Frank Klemm


--smart should not be used. The idea behind --smart was
to speed up indexing by skipping always processed file.
This makes trouble with album settings.


Well, VorbisGain is smart enough to handle that (when --fast is specified). biggrin.gif If one track in an album lacks replaygain tags, the entire album is recalculated.

cool.gif
Lear
QUOTE
Originally posted by YinYang


Now THIS sounds VERY promising. That would be perfect smile.gif


But don't expect anything from me soon. I might look into adding MP3, but I don't need MPC or WAV at the moment.

The sources are out there...
YinYang
QUOTE
Originally posted by Lear


But don't expect anything from me soon. I might look into adding MP3, but I don't need MPC or WAV at the moment.


Oh I won't expect anything. That way I can only be peasantly surprised.
I just love the idea, and wanted to voice my moral support.
Frank Klemm
QUOTE
Originally posted by Garf
Is there any way to have MPC ReplayGain automatically traverse a directory tree, and automatically calculate both album and track gain (upon the assumption that each album is in a seperate dir), and skip the already replaygained/non-mpc files?

i.e. I'd like to do

replaygain --smart --recurse --album --skip c:music*.mp+

The Vorbis ReplayGain tool already allows this...I'd like it for MPC too.

BTW. What K setting do I need to make MPC ReplayGained files sound as loud as Vorbis ReplayGained files?

-- 
GCP


Where's the replaygain in Ogg fils stored?
Is there a command line decoder supporting pipes and level adjustment ?
Case
QUOTE
Originally posted by Frank Klemm

Where's the replaygain in Ogg fils stored?
Is there a command line decoder supporting pipes and level adjustment ?

Replaygain settings are stored in tags. John33 has made decoder that supports stdout, sources are available here. I don't think it supports level adjustments.
Garf
QUOTE
Originally posted by Frank Klemm


Where's the replaygain in Ogg fils stored?
Is there a command line decoder supporting pipes and level adjustment ?


ReplayGain info is stored in tags in the Vorbis comment headers. If you're looking for actual technical specs, I fear you're going to be out of luck (maybe somewhere on xiph.org? Edit:http://xiph.org/ogg/vorbis/docs.html). As everybody and his dog have pointed out the last few weeks, Ogg is definetely lacking in that department. The format of the ReplayGain tags in the comment header is described somewhere on this boards archive. You should have no problem turning those up with the search function. (Edit:http://www.hydrogenaudio.org/forums/showth...t=State+of+Play)

As for a command line decoder, I think ogg123 supports pipes (not on Windows). I don't think it allows level adjustments.

--
GCP
qristus
QUOTE
Originally posted by Case

Actually now that I studied this thing better it is possible with current replaygain. The command to do this is

replaygain --smart --auto c:music


I tried this (without the --smart) and it does not calculate album gain for the separate directories (it sees all the files as one big album).

I made a couple of batch files to do the job for me for now, these will work as long as you have your files stored two directories deep (like Artist/Album), and as long as no artist name has more than 8 spaces in it (does anyone know a windows equivalent of bash's $* special parameter?)

gainall.cmd:
CODE
@for /D %%x in (*) do gaindir.cmd %%x


gaindir.cmd:
CODE
@echo off

cd "%1 %2 %3 %4 %5 %6 %7 %8 %9"

for /D %%y in (*) do replaygain --auto "%%y"

cd ..
Garf
QUOTE
Originally posted by qristus

I tried this (without the --smart) and it does not calculate album gain for the separate directories (it sees all the files as one big album).


Yes. Because of this, using the tool in this way is useless for me.


QUOTE

I made a couple of batch files to do the job for me for now, these will work as long as you have your files stored two directories deep (like Artist/Album), and as long as no artist name has more than 8 spaces in it (does anyone know a windows equivalent of bash's $* special parameter?)


Trying to execute these just gives me a syntaxis error.

--
GCP
qristus
QUOTE
Originally posted by Garf

Trying to execute these just gives me a syntaxis error.

Strange, they work for me. What is the error exactly? The idea is that you execute gainall.cmd in the main directory without any parameters, then it should traverse the directory tree and do the replaygaining automatically.

So if your music is stored like c:mp3artistalbum, copy both files to the c:mp3 directory or a directory in your path, cd to c:mp3 and execute gainall.cmd.

What system are you on? These should work on XP and 2000 at least, if you're on 95 or 98 try renaming them to .bat, just remember to change gaindir.cmd to gaindir.bat in the gainall.bat file smile.gif I've only tested this on XP, but I didn't have any problems here.

edit:
Yay, no longer a junior member smile.gif
Garf
The error is just 'Syntaxis Error'. I'm on WinME. I already renamed them to .bat files.

At a guess, you're using a switch or command that isn't supported by WinME.

(My directory structure also doesn't have 2 level, i.e. it's only a seperate dir for each album with the artists all mixed.)

--
GCP
Case
I don't want to mess with ReplayGain sources, they look too scary smile.gif. I made a quick sweep command that can be used in the mean time to recursively apply replaygain or any other command in subdirectories. Windows binary and sources included http://www.saunalahti.fi/~cse/Sweep.zip (only 3KB). To use the program go to first directory to be replaygained and type:
sweep replaygain --auto *.mpc
qristus
QUOTE
Originally posted by Garf
The error is just 'Syntaxis Error'. I'm on WinME. I already renamed them to .bat files.

At a guess, you're using a switch or command that isn't supported by WinME. 

I rebooted into Win98 and you're right, "for" doesn't support the /D switch there. And without it, it doesn't pick up directories.

Case beat me to it, but in case anyone's feeling masochistic here's a vbscript alternative smile.gif

gain.vbs:
CODE


'-------------------'

' Parental Advisory '

  option explicit  '

'-------------------'



dim oFSO, oShell



set oFSO = CreateObject("scripting.filesystemobject")

set oShell = CreateObject("wscript.shell")

ScanFolder(".")



function ScanFolder(byVal sPath)

   dim oFolder, oFC, oEntity

   set oFolder = oFSO.GetFolder(sPath)

   set oFC = oFolder.SubFolders

   for each oEntity in oFC

       ScanFolder(oEntity.Path)

   next

   set oFC = oFolder.Files

   for each oEntity in oFC

       if lcase(right(oEntity.Name, 4)) = ".mpc" then

           oShell.Run "%comspec% /c replaygain.exe --auto """ & sPath & """", 1, true

           exit for

       end if

   next

end function



Make a batch file something like this:

gainall.bat
CODE


@wscript x:path_to_gain.vbsgain.vbs



and run from the directory where you want to start 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-2008 Invision Power Services, Inc.