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
|
Rev | Line | |
---|
[d44763f] | 1 | #! /usr/bin/env python |
---|
[78561f7] | 2 | import sys |
---|
| 3 | import aubio |
---|
[d44763f] | 4 | |
---|
[78561f7] | 5 | samplerate = 0 # use original source samplerate |
---|
[d44763f] | 6 | hop_size = 256 # number of frames to read in one block |
---|
[78561f7] | 7 | src = aubio.source(sys.argv[1], samplerate, hop_size) |
---|
[d44763f] | 8 | total_frames = 0 |
---|
| 9 | |
---|
[78561f7] | 10 | while True: |
---|
| 11 | samples, read = src() # read hop_size new samples from source |
---|
| 12 | total_frames += read # increment total number of frames |
---|
[30e080c] | 13 | if read < hop_size: break # end of file reached |
---|
[d44763f] | 14 | |
---|
| 15 | fmt_string = "read {:d} frames at {:d}Hz from {:s}" |
---|
[78561f7] | 16 | print (fmt_string.format(total_frames, src.samplerate, src.uri)) |
---|
Note: See
TracBrowser
for help on using the repository browser.