source: python/aubiopitch @ 77494e7

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 77494e7 was 96fb8ad, checked in by Paul Brossier <piem@altern.org>, 20 years ago

import 0.1.7.1

  • Property mode set to 100755
File size: 739 bytes
Line 
1#!/usr/bin/python
2
3def do(filein):
4    from aubio import aubioclass
5    hopsize   = 512
6    bufsize   = 4096
7    frameread = 0
8    filei     = aubioclass.sndfile(filein)
9    srate     = filei.samplerate()
10    channels  = filei.channels()
11    myvec     = aubioclass.fvec(hopsize,channels)
12    readsize  = filei.read(hopsize,myvec)
13    ppick     = aubioclass.pitchpick(bufsize,hopsize,channels,myvec,srate)
14    while(readsize==hopsize):
15        readsize = filei.read(hopsize,myvec)
16        val = ppick.do(myvec)
17        freq = aubioclass.bintofreq(val,srate,bufsize)
18        now = (frameread)*hopsize/(srate+0.)
19        print "%.3f     %.2f" % (now,freq)
20        frameread += 1
21
22if __name__ == "__main__":
23    import sys
24    do(sys.argv[1])
Note: See TracBrowser for help on using the repository browser.