History

doc/python_module.rst: add demo_source_simple.py

Paul Brossier committed 10 years ago

Commit d44763f1 parent 2f965e22 files · +33 −17Browse files

Showing the changes to python (1 of 2 files). Show all

Unified · Split

python/demos/demo_source_simple.py+16−0
@@ -0,0 +1,16 @@
1#! /usr/bin/env python
2import sys, aubio
3
4samplerate = 0 # use original source samplerate
5hop_size = 256 # number of frames to read in one block
6s = aubio.source(sys.argv[1], samplerate, hop_size)
7total_frames = 0
8
9while True: # reading loop
10 samples, read = s()
11 total_frames += read
12 if read < hop_size: break # end of file reached
13
14fmt_string = "read {:d} frames at {:d}Hz from {:s}"
15print (fmt_string.format(total_frames, s.samplerate, sys.argv[1]))
16

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