Changeset 2bd1a2a for python


Ignore:
Timestamp:
Dec 13, 2005, 6:51:59 AM (19 years ago)
Author:
Paul Brossier <piem@altern.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:
0eb4025
Parents:
f985cd6
Message:

add list_snd_files and downsample audio, temporary fix for filename check in plot functions
add list_snd_files and downsample audio, temporary fix for filename check in plot functions

Location:
python/aubio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/aubio/bench/node.py

    rf985cd6 r2bd1a2a  
    2424def list_wav_files(datapath,maxdepth=1):
    2525        return list_files(datapath, filter="f -name '*.wav' -maxdepth %d"%maxdepth)
     26
     27def list_snd_files(datapath,maxdepth=1):
     28        return list_files(datapath, filter="f -name '*.wav' -o -name '*.aif' -maxdepth %d"%maxdepth)
    2629
    2730def list_dirs(datapath):
  • python/aubio/gnuplot.py

    rf985cd6 r2bd1a2a  
    6868        g.gnuplot('unset multiplot;')
    6969
     70def downsample_audio(time,data,maxpoints=10000):
     71        """ create gnuplot plot from an audio file """
     72        import numarray
     73        length = len(time)
     74        downsample = length/maxpoints
     75        if downsample == 0: downsample = 1
     76        x = numarray.array(time).resize(length)[0:-1:downsample]
     77        y = numarray.array(data).resize(length)[0:-1:downsample]
     78        return x,y
     79
    7080def make_audio_plot(time,data,maxpoints=10000):
    7181        """ create gnuplot plot from an audio file """
     
    107117        # check if datafile exists truth
    108118        datafile = filename.replace('.wav','.txt')
     119        if datafile == filename: datafile = ""
    109120        if not os.path.isfile(datafile):
    110121                title = "truth file not found"
     
    177188        # check if ground truth exists
    178189        datafile = filename.replace('.wav','.txt')
     190        if datafile == filename: datafile = ""
    179191        if not os.path.isfile(datafile):
    180192                title = "truth file not found"
Note: See TracChangeset for help on using the changeset viewer.