Skip to content

Commit da1fae1

Browse files
committed
added 24bit support
1 parent 0d4e7a0 commit da1fae1

File tree

4 files changed

+417
-7
lines changed

4 files changed

+417
-7
lines changed

paulstretch_mono.py

100644100755
+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212

1313
import sys
1414
from numpy import *
15-
import scipy.io.wavfile
15+
import wavfilegit
1616
import wave
1717

1818
def load_wav(filename):
1919
try:
20-
wavedata=scipy.io.wavfile.read(filename)
20+
wavedata=wavfile.read(filename)
2121
samplerate=int(wavedata[0])
2222
smp=wavedata[1]*(1.0/32768.0)
2323
if len(smp.shape)>1: #convert to mono

paulstretch_newmethod.py

100644100755
+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import sys
1616
from numpy import *
17-
import scipy.io.wavfile
17+
import wavfile
1818
import wave
1919
from optparse import OptionParser
2020

@@ -25,7 +25,7 @@
2525

2626
def load_wav(filename):
2727
try:
28-
wavedata=scipy.io.wavfile.read(filename)
28+
wavedata=wavfile.read(filename)
2929
samplerate=int(wavedata[0])
3030
smp=wavedata[1]*(1.0/32768.0)
3131
smp=smp.transpose()

paulstretch_stereo.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,21 @@
1414

1515
import sys
1616
from numpy import *
17-
import scipy.io.wavfile
17+
import wavfile
1818
import wave
1919
from optparse import OptionParser
2020

2121
def load_wav(filename):
2222
try:
23-
wavedata=scipy.io.wavfile.read(filename)
23+
wavedata=wavfile.read(filename)
2424
samplerate=int(wavedata[0])
2525
smp=wavedata[1]*(1.0/32768.0)
2626
smp=smp.transpose()
2727
if len(smp.shape)==1: #convert to stereo
2828
smp=tile(smp,(2,1))
2929
return (samplerate,smp)
30-
except:
30+
except(e):
31+
print("error: "+e)
3132
print ("Error loading wav: "+filename)
3233
return None
3334

@@ -146,6 +147,7 @@ def paulstretch(samplerate,smp,stretch,windowsize_seconds,outfilename):
146147

147148
print ("stretch amount = %g" % options.stretch)
148149
print ("window size = %g seconds" % options.window_size)
150+
print args
149151
(samplerate,smp)=load_wav(args[0])
150152

151153
paulstretch(samplerate,smp,options.stretch,options.window_size,args[1])

0 commit comments

Comments
 (0)