Changeset 155cc10 for python/demos/demo_source.py
- Timestamp:
- Mar 10, 2017, 2:26:32 PM (7 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, sampler
- Children:
- ee8a57c
- Parents:
- 00d0275 (diff), 67b6618 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/demos/demo_source.py
r00d0275 r155cc10 6 6 if __name__ == '__main__': 7 7 if len(sys.argv) < 2: 8 print 'usage: %s <inputfile> [samplerate] [hop_size]' % sys.argv[0]8 print('usage: %s <inputfile> [samplerate] [hop_size]' % sys.argv[0]) 9 9 sys.exit(1) 10 10 samplerate = 0 … … 21 21 total_frames += read 22 22 if read < f.hop_size: break 23 print "read", "%.2fs" % (total_frames / float(samplerate) ), 24 print "(", total_frames, "frames", "in", 25 print total_frames / f.hop_size, "blocks", "at", "%dHz" % f.samplerate, ")", 26 print "from", f.uri 23 outstr = "read %.2fs" % (total_frames / float(samplerate)) 24 outstr += " (%d frames in" % total_frames 25 outstr += " %d blocks" % (total_frames // f.hop_size) 26 outstr += " at %dHz)" % f.samplerate 27 outstr += " from " + f.uri 28 print(outstr)
Note: See TracChangeset
for help on using the changeset viewer.