Sound file manipulation in Python

P

Paul Moore

Does anyone know of a Python library which handles sound file formats
(MP3, Ogg, FLAC are the three I'm nost interested in). I'd like
something that can manipulate "metadata" - stuff like artist, title,
album tags. I'm not critically interested in format conversion, or
playing sound files - I can handle that with other applications.

I'm using Windows, and Python 2.3, if it matters (as it might for C
extensions).

I can manage with just reading the metadata, but ideally writing
would be useful, too. Multiple libraries is OK, but I need something
more than just MP3.

If there's nothing available for Python, does anyone know of a good C
library that could be wrapped? (Or used via ctypes, maybe).

Thanks,
Paul.
 
T

Timothy Grant

Does anyone know of a Python library which handles sound file formats
(MP3, Ogg, FLAC are the three I'm nost interested in). I'd like
something that can manipulate "metadata" - stuff like artist, title,
album tags. I'm not critically interested in format conversion, or
playing sound files - I can handle that with other applications.

I'm using Windows, and Python 2.3, if it matters (as it might for C
extensions).

I can manage with just reading the metadata, but ideally writing
would be useful, too. Multiple libraries is OK, but I need something
more than just MP3.

If there's nothing available for Python, does anyone know of a good C
library that could be wrapped? (Or used via ctypes, maybe).

Thanks,
Paul.

I'm playing with some of those things right now. You may want to look
at mad and id3tag. I know there are several others that allow you to
work with ID3 Tags.
 
D

Dmitry Borisov

Paul Moore said:
Does anyone know of a Python library which handles sound file formats
(MP3, Ogg, FLAC are the three I'm nost interested in). I'd like
something that can manipulate "metadata" - stuff like artist, title,
album tags. I'm not critically interested in format conversion, or
playing sound files - I can handle that with other applications.

I'm using Windows, and Python 2.3, if it matters (as it might for C
extensions).

I can manage with just reading the metadata, but ideally writing
would be useful, too. Multiple libraries is OK, but I need something
more than just MP3.

If there's nothing available for Python, does anyone know of a good C
library that could be wrapped? (Or used via ctypes, maybe).

You may try to use pymedia: http://pymedia.sourceforge.net
There is no writing at this point( but you may add it though ), also FLAC
not supported also.
If you need writing you may need to use ffmpeg/libavformat for that...

Dmitry/
 
T

Tom B.

Paul Moore said:
Does anyone know of a Python library which handles sound file formats
(MP3, Ogg, FLAC are the three I'm nost interested in). I'd like
something that can manipulate "metadata" - stuff like artist, title,
album tags. I'm not critically interested in format conversion, or
playing sound files - I can handle that with other applications.

I'm using Windows, and Python 2.3, if it matters (as it might for C
extensions).

I can manage with just reading the metadata, but ideally writing
would be useful, too. Multiple libraries is OK, but I need something
more than just MP3.

If there's nothing available for Python, does anyone know of a good C
library that could be wrapped? (Or used via ctypes, maybe).

Thanks,
Paul.

I would try the Snack toolkit at http://www.speech.kth.se/snack/

Highlights
High level sound objects, with flexible storage management and streaming
support.
Multiple simultaneous playback and recording threads (system dependent).

All audio data handled as floating point internally for fast and accurate
computations.
Multi-platform, same scripts usable on Windows 95/98/NT/2K/XP, Linux,
Macintosh, Sun Solaris, HP-UX, FreeBSD, NetBSD, and SGI IRIX.

Script compilation tool included, for easy deployment using stand-alone
executables.

Filters which can be used to process sound objects or during playback for
on-the-fly operation.

Visualization with waveforms, spectrograms, and spectrum sections.
Postscript support.

Real-time visualization/spectrum analysis.

Web enabled, possible to run scripts embedded in web pages through the use
of the Tcl plug-in.

Extensible, new commands, filters, and sound file formats can be added
using the Snack C-library.

Lots of examples included as well as a skeleton C-extension.

Supported sound file formats: WAV, AU, AIFF, MP3, CSL, SD, SMP, and
NIST/Sphere




Tom
 
D

Dmitry Borisov

Paul Moore said:
Looks nice. I'll give it a try.


Not something I need right now.


A pity, but not as important to me as Ogg. How hard is it to add
codecs to pymedia?

I don't see any special handling for flac. So I suppose it may use regular
raw format for demuxing. In this case, it will be trivial to include
libavcode/flac.c from ffmpeg into pymedia. No changes. For meta tags, you
may need to do a small research and write a simple parser.
Dmitry/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top