Ignore:
Timestamp:
May 16, 2016, 3:16:00 AM (9 years ago)
Author:
Paul Brossier <piem@piem.org>
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
Message:

python/demos: python3 and double precision compatibility

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/demos/demo_pitch.py

    r416ddd1 r4120fbc  
    55
    66if len(sys.argv) < 2:
    7     print "Usage: %s <filename> [samplerate]" % sys.argv[0]
     7    print("Usage: %s <filename> [samplerate]" % sys.argv[0])
    88    sys.exit(1)
    99
     
    1111
    1212downsample = 1
    13 samplerate = 44100 / downsample
     13samplerate = 44100 // downsample
    1414if len( sys.argv ) > 2: samplerate = int(sys.argv[2])
    1515
    16 win_s = 4096 / downsample # fft size
    17 hop_s = 512  / downsample # hop size
     16win_s = 4096 // downsample # fft size
     17hop_s = 512  // downsample # hop size
    1818
    1919s = source(filename, samplerate, hop_s)
     
    3737    confidence = pitch_o.get_confidence()
    3838    #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))
    4040    pitches += [pitch]
    4141    confidences += [confidence]
Note: See TracChangeset for help on using the changeset viewer.