1

I am looking for a high level audio library that supports crossfading for python (and that works in linux). In fact crossfading a song and saving it is about the only thing I need.

I tried pyechonest but I find it really slow. Working with multiple songs at the same time is hard on memory too (I tried to crossfade about 10 songs in one, but I got out of memory errors and my script was using 1.4Gb of memory). So now I'm looking for something else that works with python.

I have no idea if there exists anything like that, if not, are there good command line tools for this, I could write a wrapper for the tool.

tcoopman
  • 125
  • 4

2 Answers2

1

A list of Python sound libraries.

Play a Sound with Python

PyGame or Snack would work, but for this, I'd use something like audioop.

— basic first steps here : merge background audio file

Community
  • 1
  • 1
Rizwan Kassim
  • 7,421
  • 3
  • 22
  • 33
0

A scriptable solution using external tools AviSynth and avs2wav or WAVI:

Create an AviSynth script file: test.avs

v=ColorBars() 
a1=WAVSource("audio1.wav").FadeOut(50) 
a2=WAVSource("audio2.wav").Reverse.FadeOut(50).Reverse
AudioDub(v,a1+a2)

Script fades out on audio1 stores that in a1 then fades in on audio2 and stores that in a2.

a1 & a2 are concatenated and then dubbed with a Colorbar screen pattern to make a video. You can't just work with audio alone - a valid video must be generated.

I kept the script as simple as possible for demonstration purposes. Google for more details on audio processing via AviSynth.

Now using avs2wav (or WAVI) you can render the audio:

avs2wav.exe test.avs combined.wav

or

wavi.exe test.avs combined.wav

Good luck!

Some references:

How to edit with Avisynth

AviSynth filters reference

symmetry
  • 424
  • 3
  • 4
  • DirectShowSource requires, um, Direct Show. The OP is looking for Linux Support. – Rizwan Kassim Jun 06 '10 at 22:04
  • I removed the DirectShow reference. The above was simply a proof of concept and up to the OP to adapt to his purposes. I am aware that AviSynth can be used on Linux and the link I gave to WAVI includes source code. – symmetry Jun 06 '10 at 22:21