source: python/demos/demo_sink.py @ 223e2fe

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

moved tests to subdirectory

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