Re: [linux-audio-dev] Sound file format detection?

From: Frank Barknecht <fbar@email-addr-hidden>
Date: Sun Oct 02 2005 - 20:55:17 EEST

Hallo,
Mario Lang hat gesagt: // Mario Lang wrote:

> My little time-compressing audio player yatm currently supports 3 different
> audio formats, ogg and speex via the xiph libraries, and mpeg via libmad.
> I currently just blindly try to launch the decoder for either ogg, speex or
> mp3 in series. SO if the first fails, I try the second, and so on. Which
> kinda works but is a bit ugly. I'd like to add flac support at some point,
> which would make this even more ugly.
> Additionally, libsndfile support wouldnt be that bad either, so, I am
> wondering, is there a reliable way to detect a audio streams file
> format just given some bits of the header?

The "file" command can specify a lot of file formats just from some
magic bits, see /etc/magic, /usr/share/misc/file/magic and magic(5)
for this.

Additionally there are some more programs for getting at detailed info
for soundfiles, like sndinfo included in Csound. Maybe you can rip
some of their logic.

Ciao

-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
Received on Mon Oct 3 00:15:05 2005

This archive was generated by hypermail 2.1.8 : Mon Oct 03 2005 - 00:15:05 EEST