2

I'm writing a program where I need to be able to rip files from a CD into WAV format (or flac but wav works fine). It must run on Windows. I saw other answers where Express Rip and Audio Commander were recommended as command line tools. But Audio Commander's page doesn't seem to exist anymore. And I'm not so sure about express rip, it seems a bit sketchy.

Then they mentioned mutagen for retrieving the metadata.

Anyone have any experience with these utilities or this goal? I would like to be able to rip a CD in WAV, keep the metadata that is there, and if possible check the CD Archive for metadata as well.

Anyone ever do anything like this or have an suggestions on modules, utilities, methods, etc. to get me going? Even some small examples would help. That is examples of ripping a cd with python, or modules to accomplish the task.

ss7
  • 2,902
  • 7
  • 41
  • 90
  • This might be a good question for SoftwareRecs (just a guess; read [their help](https://softwarerecs.stackexchange.com/help), but it's definitely not a good question for StackOverflow. – abarnert May 27 '15 at 03:20
  • Anyway, the [Mutagen docs](https://mutagen.readthedocs.org/en/latest/) and [repo](https://bitbucket.org/lazka/mutagen/) both still work for me (and I just `pip install`ed it a few days ago for PyPy, too). Where are you looking for these things? If you're reading blog posts from 2007 or something, don't expect them to be constantly updated… – abarnert May 27 '15 at 03:21
  • Im looking for info anywhere I can find it, hard to find current stuff about this. – ss7 May 27 '15 at 13:10

1 Answers1

2

You might want to have a look at PyMedia

PyMedia is a Python module for wav, mp3, ogg, avi, divx, dvd, cdda etc files manipulations. It allows you to parse, demutiplex, multiplex, decode and encode all supported formats. It can be compiled for Windows, Linux and cygwin.

PyMedia was built to be really simple and flexible at the same time. See tutorial for example. It allows you to create your own multimedia applications in a matter of minutes and adjust it to your needs using other components. Python language is chosen because of simple semantics, complete and reach set of features.

You can also use this as a library:

From their Audio CD Grabber:

import pymedia.removable.cd as cd

def readTrack(track, offset, bytes):
  cd.init()
  if cd.getCount() == 0:
    print 'There is no cdrom found. Bailing out...'
    return 0

  c = cd.CD(0)
  props = c.getProperties()
  if props['type'] != 'AudioCD':
    print 'Media in %s has type %s, not AudioCD. Cannot read audio data.' % (c.getName(), props['type'])
    return 0

  tr0 = c.open(props['titles'][track - 1]['name'])
  tr0.seek(offset, cd.SEEK_SET)
  return tr0.read(bytes)

Update: For accessing metadata about the Audio CD you can use the PyCDDB lirbary.

James Mills
  • 18,669
  • 3
  • 49
  • 62