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_mel-energy.py

    r416ddd1 r4120fbc  
    66
    77win_s = 512                 # fft size
    8 hop_s = win_s / 4           # hop size
     8hop_s = win_s // 4          # hop size
    99
    1010if len(sys.argv) < 2:
    11     print "Usage: %s <filename> [samplerate]" % sys.argv[0]
     11    print("Usage: %s <filename> [samplerate]" % sys.argv[0])
    1212    sys.exit(1)
    1313
     
    3535    fftgrain = pv(samples)
    3636    new_energies = f(fftgrain)
    37     print '%f' % (total_frames / float(samplerate) ),
    38     print ' '.join(['%f' % b for b in new_energies])
     37    timestr = '%f' % (total_frames / float(samplerate) )
     38    print('{:s} {:s}'.format(timestr, ' '.join(['%f' % b for b in new_energies])))
    3939    energies = vstack( [energies, new_energies] )
    4040    total_frames += read
     
    4242
    4343if 1:
    44     print "done computing, now plotting"
     44    print("done computing, now plotting")
    4545    import matplotlib.pyplot as plt
    4646    from demo_waveform_plot import get_waveform_plot
Note: See TracChangeset for help on using the changeset viewer.