Connecting Tech Pros Worldwide Forums | Help | Site Map

Sound file manipulation in Python

Paul Moore
Guest
 
Posts: n/a
#1: Jul 18 '05
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.
--
Ooh, how Gothic. Barring the milk.

Timothy Grant
Guest
 
Posts: n/a
#2: Jul 18 '05

re: Sound file manipulation in Python


On Thu, 26 Aug 2004 22:24:33 +0100, Paul Moore <pf_moore@yahoo.co.uk> wrote:[color=blue]
> 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.
> --
> Ooh, how Gothic. Barring the milk.
> --
> http://mail.python.org/mailman/listinfo/python-list
>[/color]

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.


--
Stand Fast,
tjg.
Dmitry Borisov
Guest
 
Posts: n/a
#3: Jul 18 '05

re: Sound file manipulation in Python


"Paul Moore" <pf_moore@yahoo.co.uk> wrote in message
news:uu0upzj72.fsf@yahoo.co.uk...[color=blue]
> 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).
>[/color]

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/


Tom B.
Guest
 
Posts: n/a
#4: Jul 18 '05

re: Sound file manipulation in Python



"Paul Moore" <pf_moore@yahoo.co.uk> wrote in message
news:uu0upzj72.fsf@yahoo.co.uk...[color=blue]
> 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.
> --
> Ooh, how Gothic. Barring the milk.[/color]

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


Paul Moore
Guest
 
Posts: n/a
#5: Jul 18 '05

re: Sound file manipulation in Python


"Tom B." <sbabbitt@commspeed.net> writes:
[color=blue]
> I would try the Snack toolkit at http://www.speech.kth.se/snack/[/color]

Looks good, but more focused on manipulation and playback. I couldn't
see any handling of tags/metadata.
[color=blue]
> Supported sound file formats: WAV, AU, AIFF, MP3, CSL, SD, SMP, and
> NIST/Sphere[/color]

No Ogg or FLAC :-(

I'll keep it in mind, though.

Paul.
--
"Bother," said the Borg, "We've assimilated Pooh."
Paul Moore
Guest
 
Posts: n/a
#6: Jul 18 '05

re: Sound file manipulation in Python


"Dmitry Borisov" <jbors@mail.ru> writes:
[color=blue]
> You may try to use pymedia: http://pymedia.sourceforge.net[/color]

Looks nice. I'll give it a try.
[color=blue]
> There is no writing at this point( but you may add it though ),[/color]

Not something I need right now.
[color=blue]
> also FLAC not supported also.[/color]

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

Paul.
--
The major difference between a thing that might go wrong and a thing
that cannot possibly go wrong is that when a thing that cannot
possibly go wrong goes wrong it usually turns out to be impossible to
get at or repair. -- Douglas Adams
Dmitry Borisov
Guest
 
Posts: n/a
#7: Jul 18 '05

re: Sound file manipulation in Python


"Paul Moore" <pf_moore@yahoo.co.uk> wrote in message
news:uk6vk4f2f.fsf@yahoo.co.uk...[color=blue]
> "Dmitry Borisov" <jbors@mail.ru> writes:
>[color=green]
> > You may try to use pymedia: http://pymedia.sourceforge.net[/color]
>
> Looks nice. I'll give it a try.
>[color=green]
> > There is no writing at this point( but you may add it though ),[/color]
>
> Not something I need right now.
>[color=green]
> > also FLAC not supported also.[/color]
>
> A pity, but not as important to me as Ogg. How hard is it to add
> codecs to pymedia?[/color]

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/


Closed Thread