Changeset 4120fbc for python/demos/demo_pitch.py
- Timestamp:
- May 16, 2016, 3:16:00 AM (9 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, pitchshift, sampler, timestretch, yinfft+
- Children:
- dc654f8
- Parents:
- 416ddd1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/demos/demo_pitch.py
r416ddd1 r4120fbc 5 5 6 6 if len(sys.argv) < 2: 7 print "Usage: %s <filename> [samplerate]" % sys.argv[0]7 print("Usage: %s <filename> [samplerate]" % sys.argv[0]) 8 8 sys.exit(1) 9 9 … … 11 11 12 12 downsample = 1 13 samplerate = 44100 / downsample13 samplerate = 44100 // downsample 14 14 if len( sys.argv ) > 2: samplerate = int(sys.argv[2]) 15 15 16 win_s = 4096 / downsample # fft size17 hop_s = 512 / downsample # hop size16 win_s = 4096 // downsample # fft size 17 hop_s = 512 // downsample # hop size 18 18 19 19 s = source(filename, samplerate, hop_s) … … 37 37 confidence = pitch_o.get_confidence() 38 38 #if confidence < 0.8: pitch = 0. 39 #print "%f %f %f" % (total_frames / float(samplerate), pitch, confidence)39 print("%f %f %f" % (total_frames / float(samplerate), pitch, confidence)) 40 40 pitches += [pitch] 41 41 confidences += [confidence]
Note: See TracChangeset
for help on using the changeset viewer.