Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Renaming already ripped wave files
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
vinz
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2002
Posts: 93
Location: Switzerland

PostPosted: Thu May 06, 2010 2:36 pm    Post subject: Renaming already ripped wave files Reply with quote

hello
we use a robot to rip audio CDs (we do have licenses to do that, nothing illegal done). sadly, the robot control software is very limited and running on windows, so the only option is to rip CDs and store the wave files and process them elsewhere.

anyway, we end up having folders for each CD which contain each track as wave files

the goal is to make a look up on CDDB and rename the folders and tracks accordingly

there are tools to rip CDs and retrieve the meta data from cddb (like ripperx or abcde), but i haven't found a tool to look up the meta data from already ripped data (should be possible...)

anyone got an idea?

thanks in advance :D
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Thu May 06, 2010 5:16 pm    Post subject: Reply with quote

Quote:
but i haven't found a tool to look up the meta data from already ripped data (should be possible...)


From Wikipedia,
http://en.wikipedia.org/wiki/CDDB#How_CDDB_works wrote:
CDDB was designed around the task of identifying entire CDs, not merely single tracks. The identification process involves creating a "discid", a sort of "fingerprint" of a CD created by performing calculations on the track duration information stored in the table-of-contents of the CD (see the following section for an example calculation). This discid is used with the Internet database, typically either to download track names for the whole CD or to submit track names for a newly-identified CD.

It doesn't seem like CDDB analysis could be done after the music was ripped, mostly because the data used to fingerprint CDS is "stored in the table-of-contents of the CD".

However, moving to FreeDB's CDDB1 fingerprinting, it seems that all you'd need to know for this are:
  • the starting times of each track
  • the total time of the CD in seconds from the start of the first track to the end of the last track
  • the number of tracks on the CD.


Unfortunately I don't think the inter-track gap period is necessarily picked up by ripping software but it's apparently usually 2 seconds (unless it's pink floyd you're ripping ; ) So it seems that in a pinch you could maybe check against the FreeDB database after you ripped the wav files.

Another option is running one of the "Sample code for calculating CDDB1 disc IDs" which is apparently available "in various programming languages...on the web". If you could get a python or java ID program working maybe you could have it save the fingerprint in the same place as the wav files; then all you'd have to do is query the database and stuff the ID3 tags (or whatever). I like this idea the most.
_________________
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Back to top
View user's profile Send private message
vinz
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2002
Posts: 93
Location: Switzerland

PostPosted: Mon May 10, 2010 9:17 am    Post subject: Reply with quote

alright, thanks for the infos, i'll try to write a c program to assemble the id
Back to top
View user's profile Send private message
alexbuell
Guru
Guru


Joined: 18 Jul 2002
Posts: 490
Location: "Hemp"shire, UK

PostPosted: Mon May 10, 2010 9:42 am    Post subject: Reply with quote

vinz wrote:
alright, thanks for the infos, i'll try to write a c program to assemble the id


Sounds like you need to get the "fingerprints" from the original audio CDs and tie them to the ripped copies. Then use the information from CDDB to rewrite the albums and their song titles, no?
_________________
Cheers,
Alex.

Linux - the best text adventure game ever.
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Mon May 10, 2010 1:55 pm    Post subject: Reply with quote

vinz wrote:
alright, thanks for the infos, i'll try to write a c program to assemble the id
With only the wav files, this might work for up to 40-60% of your rips, perhaps even less.

Two things you'll need which you won't be able to determine from the wav files alone, the offset of the first track and the offset & length of the last track.
For the former, you can use 150 samples as the default, but there are plenty CDs which have larger values, looking at the 259 cddb xmcd files I have in my cache, 142 of them have values larger than 150...

As for the last track, this might not seem like a problem, but data tracks ("enhanced CDs") are included in the cddb id calculation, so for any CDs you've ripped which have such tracks you won't be able to calculate the correct id.

FWIW, I have the workings of a shell script which calculates the cddb id based on the offsets `cdparanoia -Q` reports, unfortunately cdparanoia doesn't report data tracks either, but if you need a hand with the calculation I may be able to help.

If you could actually save the CD table of contents (toc) to a text file when ripping, this would be much more doable, but I'm guessing that's not an option?

HTH
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
vinz
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2002
Posts: 93
Location: Switzerland

PostPosted: Mon May 10, 2010 3:52 pm    Post subject: Reply with quote

i've found an option to rip the CD including the TOC (including stuff like PregapBlock), which results a binary file with this at the beginning

i should be able to parse and calculate the ID from this. can you send me the shell script please? i've found some C source code but this piece does not consider the frames which would be inaccurate

Code:
<?xml version="1.0"?>
<!DOCTYPE FullDiscMap SYSTEM "\\AAMODT\Rimage\XML\FullDiscMap_1.1.dtd">
<FullDiscMap>
        <DiscInfo FreeBlocks="0" FirstFreeBlock="0" LeadoutStartBlock="289369" NumberOfSessions="1" NumberOfTracks="16" FirstLeadinBlockMsf="00m00s00f" NumberOfDvdLayers="0" RawMode="false" MediaType="CD-R">
                <SessionInfo SessionNumber="1" SessionType="Standard" LeadinControl="0" LeadoutControl="0" LeadoutStartBlock="289369" NextSessionStartBlock="0" Open="false">
                        <TrackInfo SessionNumber="1" TrackNumber="1" TrackType="Audio" StartBlock="0" NumberOfBlocks="1483" PregapBlocks="150" PostgapBlocks="0" HasRunoutBlocks="false" HasTrailingPregap="false" MaxIndex="1" Iso9660="false" Joliet="false" UDF="false" BlockSize="2352">
                                <SubchannelControlBits PreEmphasis="false" AllowCopy="false" Data="false" FourChannel="false"/>
                        </TrackInfo>
                        <TrackInfo SessionNumber="1" TrackNumber="2" TrackType="Audio" StartBlock="1483" NumberOfBlocks="17709" PregapBlocks="0" PostgapBlocks="0" HasRunoutBlocks="false" HasTrailingPregap="false" MaxIndex="1" Iso9660="false" Joliet="false" UDF="false" BlockSize="2352">
                                <SubchannelControlBits PreEmphasis="false" AllowCopy="false" Data="false" FourChannel="false"/>
                        </TrackInfo>
[....]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum