feature/constantq
Last change
on this file since 088760e was
78561f7,
checked in by Paul Brossier <piem@piem.org>, 6 years ago
|
[doc] improve demos used in examples
|
-
Property mode set to
100755
|
File size:
540 bytes
|
Line | |
---|
1 | #! /usr/bin/env python |
---|
2 | import sys |
---|
3 | import aubio |
---|
4 | |
---|
5 | samplerate = 0 # use original source samplerate |
---|
6 | hop_size = 256 # number of frames to read in one block |
---|
7 | src = aubio.source(sys.argv[1], samplerate, hop_size) |
---|
8 | total_frames = 0 |
---|
9 | |
---|
10 | while True: |
---|
11 | samples, read = src() # read hop_size new samples from source |
---|
12 | total_frames += read # increment total number of frames |
---|
13 | if read < hop_size: break # end of file reached |
---|
14 | |
---|
15 | fmt_string = "read {:d} frames at {:d}Hz from {:s}" |
---|
16 | print (fmt_string.format(total_frames, src.samplerate, src.uri)) |
---|
Note: See
TracBrowser
for help on using the repository browser.