source: python/demos/demo_source.py @ b583c099

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since b583c099 was fc117d0, checked in by Paul Brossier <piem@piem.org>, 12 years ago

merge from develop

  • Property mode set to 100755
File size: 405 bytes
RevLine 
[7175ed4]1#! /usr/bin/env python
[b0ac9cd]2
3import sys
4from aubio import source
5
6if __name__ == '__main__':
7  if len(sys.argv) < 2:
8    print 'usage: %s <inputfile>' % sys.argv[0]
9    sys.exit(1)
[5314432]10  f = source(sys.argv[1], 1, 256)
11  samplerate = f.get_samplerate()
[b0ac9cd]12  total_frames, read = 0, 256
13  while read:
14    vec, read = f()
15    total_frames += read
[5314432]16  print "read", total_frames / float(samplerate), "seconds from", f.uri
Note: See TracBrowser for help on using the repository browser.