Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Need to combine several wav files into one mp3 file and adjust the volume

by jjn1056 (Novice)
on Apr 12, 2005 at 19:23 UTC ( [id://447144] : perlquestion . print w/replies, xml ) Need Help??

jjn1056 has asked for the wisdom of the Perl Monks concerning the following question:

I've been trying to work out this audio project I have. There are a TON of audio related stuff in CPAN and variously scattered on the web but I can't come close to figuring out a way to do what I need. I hope that someone out there has faced a similar problem and can offer a suggestion.

I have four .wav files that I need to combine into a single mp3 file. This is sort of like where you have a 4 track recorder and you downmix it to a single track for mono playback. Like the mixer analog I mentioned, I need to be able to vary the volume levels of each of the 4 track independently.

Oh, and to make it harder, I need something that should have a chance to compile on windowsXP :(

This is for a web services project where people will mix their own tracks and create mp3 files of their created works, so it has to be something that can run on a web server and not take the box down. I can afford a big box, but I am expecting loads of up to 3-8 submissions per second.

Help.

  • Comment on Need to combine several wav files into one mp3 file and adjust the volume

Replies are listed 'Best First'.
Re: Need to combine several wav files into one mp3 file and adjust the volume
by PodMaster (Abbot) on Apr 13, 2005 at 02:12 UTC
Re: Need to combine several wav files into one mp3 file and adjust the volume
by zentara (Archbishop) on Apr 13, 2005 at 13:57 UTC
    I think you want SDL-Mixer. The docs from activestate are the best for this module. SDL-Mixer . It allows you to simultaneously play different wavs on different channels simultaneously, and adjust each channels volume. I havn't tried to do the mixing without actually playing, but it should be possible. In other words, output to a file, rather than the dsp.

    I toyed around with it and here are a few scripts to look at: SDL sound sampler-mixer and Tk Game Sound demo

    As a last resort, you could play them through the SDL-mixer, adjuting each channel, volume to your liking, then record it directly off of the /dev/dep with arecord and pipe it to lame for mp3 encoding.

    I'm sure it can all be done, it will just take some hacking.


    I'm not really a human, but I play one on earth. flash japh

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://447144]
Approved by jbrugger
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-02-26 02:15 GMT
Voting Booth?
My favourite way to spend a leap day ...











Results (24 votes). Check out past polls.