[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Reading in MP3 files in Ruby

atribole

10/29/2003 12:57:00 AM

Hi all,
I'm pretty new to Ruby, and I came across the Ruby bindings
(http://pablotron.org/softwar...) to the musicbrainz project
(musicbrainz.org).

I'd like to use Ruby to generate acoustic fingerprints when fed an MP3
file. Reading over the API, I see this method that looks like it will
do what I want:

/*
* Pass raw PCM data to generate a signature.
*
* Note: MusicBrainz::TRM#pcm_data must be called before this
function.
*
* Returns true if enough data has been sent to generate a signature,
* and false if more data is needed.
*
* Example:
* trm.generate_signature buf, BUFSIZ
*
*/
static VALUE mb_trm_gen_sig(VALUE self, VALUE buf) {


However, I'm not sure how I'd go about passing raw PCM data to Ruby.
Any suggestions?

Thanks alot!
1 Answer

Simon Strandgaard

10/29/2003 10:07:00 PM

0

On Tue, 28 Oct 2003 16:57:14 -0800, Andrew Triboletti wrote:

> Hi all,
> I'm pretty new to Ruby, and I came across the Ruby bindings
> (http://pablotron.org/softwar...) to the musicbrainz project
> (musicbrainz.org).
>
> I'd like to use Ruby to generate acoustic fingerprints when fed an MP3
> file. Reading over the API, I see this method that looks like it will
> do what I want:
[snip code]
> However, I'm not sure how I'd go about passing raw PCM data to Ruby.
> Any suggestions?

If I understand you correct, you want to pass PCM data from a C/C++
extension into Ruby ?

Then I would suggest using SWIG (scalable wrapper interface generator).
Its a RAD tool which can generate the necessary wrapper code for you.
http://www...

--
Simon Strandgaard