Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/demos/demo_source_simple.py

    r78561f7 re6ce204  
    11#! /usr/bin/env python
    2 import sys
    3 import aubio
     2import sys, aubio
    43
    5 samplerate = 0 # use original source samplerate
     4samplerate = 0  # use original source samplerate
    65hop_size = 256 # number of frames to read in one block
    7 src = aubio.source(sys.argv[1], samplerate, hop_size)
     6s = aubio.source(sys.argv[1], samplerate, hop_size)
    87total_frames = 0
    98
    10 while True:
    11     samples, read = src()     # read hop_size new samples from source
    12     total_frames += read      # increment total number of frames
     9while True: # reading loop
     10    samples, read = s()
     11    total_frames += read
    1312    if read < hop_size: break # end of file reached
    1413
    1514fmt_string = "read {:d} frames at {:d}Hz from {:s}"
    16 print (fmt_string.format(total_frames, src.samplerate, src.uri))
     15print (fmt_string.format(total_frames, s.samplerate, sys.argv[1]))
     16
Note: See TracChangeset for help on using the changeset viewer.