20 lines · 591 B · Python
RawDownload
#! /usr/bin/env python """A simple example using aubio.source.""" import sysimport aubio samplerate = 0  # use original source sampleratehop_size = 256  # number of frames to read in one blocksrc = aubio.source(sys.argv[1], samplerate, hop_size)total_frames = 0 while True:    samples, read = src()  # read hop_size new samples from source    total_frames += read   # increment total number of frames    if read < hop_size:    # end of file reached        break fmt_string = "read {:d} frames at {:d}Hz from {:s}"print(fmt_string.format(total_frames, src.samplerate, src.uri))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t