@@ -33,7 +33,7 @@ def load_wav(filename):
33
33
smp = tile (smp ,(2 ,1 ))
34
34
return (samplerate ,smp )
35
35
except :
36
- print "Error loading wav: " + filename
36
+ print ( "Error loading wav: " + filename )
37
37
return None
38
38
39
39
@@ -176,9 +176,9 @@ def paulstretch(samplerate,smp,stretch,windowsize_seconds,onset_level,outfilenam
176
176
get_next_buf = False
177
177
178
178
if start_pos >= nsamples :
179
- print "100 %"
179
+ print ( "100 %" )
180
180
break
181
- print "%d %% \r " % int (100.0 * start_pos / nsamples ),
181
+ sys . stdout . write ( "%d %% \r " % int (100.0 * start_pos / nsamples ))
182
182
sys .stdout .flush ()
183
183
184
184
@@ -203,9 +203,9 @@ def paulstretch(samplerate,smp,stretch,windowsize_seconds,onset_level,outfilenam
203
203
204
204
205
205
########################################
206
- print "Paul's Extreme Sound Stretch (Paulstretch) - Python version 20110223"
207
- print "new method: using onsets information"
208
- print "by Nasca Octavian PAUL, Targu Mures, Romania\n "
206
+ print ( "Paul's Extreme Sound Stretch (Paulstretch) - Python version 20141220" )
207
+ print ( "new method: using onsets information" )
208
+ print ( "by Nasca Octavian PAUL, Targu Mures, Romania\n " )
209
209
parser = OptionParser (usage = "usage: %prog [options] input_wav output_wav" )
210
210
parser .add_option ("-s" , "--stretch" , dest = "stretch" ,help = "stretch amount (1.0 = no stretch)" ,type = "float" ,default = 8.0 )
211
211
parser .add_option ("-w" , "--window_size" , dest = "window_size" ,help = "window size (seconds)" ,type = "float" ,default = 0.25 )
@@ -214,12 +214,12 @@ def paulstretch(samplerate,smp,stretch,windowsize_seconds,onset_level,outfilenam
214
214
215
215
216
216
if (len (args )< 2 ) or (options .stretch <= 0.0 ) or (options .window_size <= 0.001 ):
217
- print "Error in command line parameters. Run this program with --help for help."
217
+ print ( "Error in command line parameters. Run this program with --help for help." )
218
218
sys .exit (1 )
219
219
220
- print "stretch amount =" , options .stretch
221
- print "window size =" , options .window_size , "seconds"
222
- print "onset sensitivity =" , options .onset
220
+ print ( "stretch amount = %g" % options .stretch )
221
+ print ( "window size = %g seconds" % options .window_size )
222
+ print ( "onset sensitivity = %g" % options .onset )
223
223
(samplerate ,smp )= load_wav (args [0 ])
224
224
225
225
paulstretch (samplerate ,smp ,options .stretch ,options .window_size ,options .onset ,args [1 ])
0 commit comments