PCM Wave time stretch
Ruby, 220 characters
s,n=$*
w=IO.binread(n).unpack r='s&lt;*'
x=[];t=[g=0]*c=w[11]
w[u=22..-1].each_slice(c){|f|g+=v=1.0/s.to_f
c.times{|h|t[h]+=f[h]*v}
(c.times{|h|x&lt;&lt;=m=t[h]/g;t[h]-=m};g-=1)until 1&gt;g}
w[u]=x;IO.binwrite'stretch.wav',w.pack(r)

This version works with ruby 1.9.3 with basic 16 bit files (e.g. no additional chunks) for any sample rate or number of channels.