Changeset b8976d6


Ignore:
Timestamp:
Aug 8, 2005, 10:53:36 PM (16 years ago)
Author:
Paul Brossier <piem@altern.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
8d84c0b
Parents:
54bf847
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/aubio/aubioclass.py

    r54bf847 rb8976d6  
    2424    def __del__(self):
    2525        del_cvec(self())
     26    def get(self,pos,chan):
     27        return fvec_read_sample(self(),chan,pos)
    2628
    2729class sndfile:
     
    204206
    205207def 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)
     
    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
Note: See TracChangeset for help on using the changeset viewer.