Using Vamp Plugins and Hosts > Getting and Using Vamp Plugins

reading mp3 files?

(1/3) > >>

no0b:
Hi all,
I just started using Vamp plugins for my project, and following the code in vamp-plugin-sdk-2.0/host/vamp-simple-host.cpp, I've managed to create a program to read in the plugins and run them. However, in my project, I'm extensively using mp3 files. (I read and process them with Marsyas compiled with madlib). From vamp-simple-host's code, it seems libsndfile is used to read in the file. This results in it only being able to read in wav files. Is there any (hopefully simple) way I can get Vamp plugins to read in mp3 files?

Thank you very much!

cannam:

Nothing about Vamp plugins themselves has any bearing on the file types your host can support -- you just have to be able to decode the audio file and pass the decoded data to the plugin.  The plugin neither knows nor cares what file type the data came from, and it certainly cannot decode mp3 or any other compressed format itself.

So, I'm afraid, your question really comes down to "how do I read and decode an mp3 file in my program?"

I imagine your choice really is to use an mp3 decoder library such as madlib (if license and so on permit), or to run the plugin host in some sort of scripting environment in which the mp3 file is decoded by a separate decoder program run in a script or batch process (e.g. mpg321) and the resulting wav file is fed to the host.

If it's any help, Sonic Annotator (http://omras2.org/SonicAnnotator) can run Vamp plugins on mp3 files, but it pulls in an awful lot of code to do so because it pulls in (GPL-licensed) libraries from Sonic Visualiser in order to save development time.  I wouldn't necessarily advise that approach if all you want is to read an mp3, but it might be worth taking a look at it.


Chris

no0b:
Ah, ok thanks! :) will look into it :)

no0b:
oh! another question:

I tried running the example plugins and several of the other downloadable plugins' tempo extractors but I keep getting 0 results. any ideas? I'm running them on wavs, and can see it being processed (i.e., i see a loooooong list of timestamps) but everything is 0. :(

cannam:

--- Quote from: no0b on March 11, 2009, 15:52:56 ---I tried running the example plugins and several of the other downloadable plugins' tempo extractors but I keep getting 0 results. any ideas? I'm running them on wavs, and can see it being processed (i.e., i see a loooooong list of timestamps) but everything is 0. :(

--- End quote ---

Does this happen if you run them with vamp-simple-host, or only with the code that you're working on?

It certainly doesn't sound (on first reading) like a problem I know about or would expect to see.


Chris

Navigation

[0] Message Index

[#] Next page

Go to full version