Ignore:
Timestamp:
May 16, 2016, 3:16:00 AM (8 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_source.py

    r416ddd1 r4120fbc  
    66if __name__ == '__main__':
    77    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])
    99        sys.exit(1)
    1010    samplerate = 0
     
    2121        total_frames += read
    2222        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.