Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added 24bit support #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions paulstretch_mono.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

import sys
from numpy import *
import scipy.io.wavfile
import wavfile
import wave

def load_wav(filename):
try:
wavedata=scipy.io.wavfile.read(filename)
wavedata=wavfile.read(filename)
samplerate=int(wavedata[0])
smp=wavedata[1]*(1.0/32768.0)
if len(smp.shape)>1: #convert to mono
Expand Down
4 changes: 2 additions & 2 deletions paulstretch_newmethod.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import sys
from numpy import *
import scipy.io.wavfile
import wavfile
import wave
from optparse import OptionParser

Expand All @@ -25,7 +25,7 @@

def load_wav(filename):
try:
wavedata=scipy.io.wavfile.read(filename)
wavedata=wavfile.read(filename)
samplerate=int(wavedata[0])
smp=wavedata[1]*(1.0/32768.0)
smp=smp.transpose()
Expand Down
8 changes: 5 additions & 3 deletions paulstretch_stereo.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@

import sys
from numpy import *
import scipy.io.wavfile
import wavfile
import wave
from optparse import OptionParser

def load_wav(filename):
try:
wavedata=scipy.io.wavfile.read(filename)
wavedata=wavfile.read(filename)
samplerate=int(wavedata[0])
smp=wavedata[1]*(1.0/32768.0)
smp=smp.transpose()
if len(smp.shape)==1: #convert to stereo
smp=tile(smp,(2,1))
return (samplerate,smp)
except:
except(e):
print("error: "+e)
print ("Error loading wav: "+filename)
return None

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

print ("stretch amount = %g" % options.stretch)
print ("window size = %g seconds" % options.window_size)
print args
(samplerate,smp)=load_wav(args[0])

paulstretch(samplerate,smp,options.stretch,options.window_size,args[1])
Expand Down
Loading