History

added cvec.get(pos,chan), added silence param to getpitch()

Paul Brossier committed 21 years ago

Commit b8976d61 parent 54bf8471 file · +7 −2Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/aubio/aubioclass.py+7−2
@@ -23,6 +23,8 @@ class cvec: · 22 unmodified lines
2323 return self.vec
2424 def __del__(self):
2525 del_cvec(self())
26+ def get(self,pos,chan):
27+ return fvec_read_sample(self(),chan,pos)
2628
2729 class sndfile:
2830 def __init__(self,filename,model=None):
@@ -203,7 +205,7 @@ def getsilences(filein,hopsize=512,silence=-70): · 174 unmodified lines
203205 return mylist
204206
205207 def getpitch(filein,mode=aubio_mcomb,bufsize=1024,hopsize=512,omode=aubio_freq,
206− samplerate=44100.):
208+ samplerate=44100.,silence=-70):
207209 frameread = 0
208210 filei = sndfile(filein)
209211 srate = filei.samplerate()
@@ -217,7 +219,10 @@ def getpitch(filein,mode=aubio_mcomb,bufsize=1024,hopsize=512,omode=aubio_freq, · 7 unmodified lines
217219 readsize = filei.read(hopsize,myvec)
218220 freq = pitchdet(myvec)
219221 #print "%.3f %.2f" % (now,freq)
220− mylist.append(freq)
222+ if (aubio_silence_detection(myvec(),silence)!=1):
223+ mylist.append(freq)
224+ else:
225+ mylist.append(0)
221226 frameread += 1
222227 return mylist
223228

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t