Changeset 494df02


Ignore:
Timestamp:
May 10, 2016, 7:40:24 PM (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:
c9a9f86
Parents:
67e16c2
Message:

python/demos/demo_bpm_extract.py: add exception type, avoid {} as default argument value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/demos/demo_bpm_extract.py

    r67e16c2 r494df02  
    44from numpy import median, diff
    55
    6 def get_file_bpm(path, params = {}):
     6def get_file_bpm(path, params = None):
    77    """ Calculate the beats per minute (bpm) of a given file.
    88        path: path to the file
    99        param: dictionary of parameters
    1010    """
     11    if params == None:
     12        params = {}
    1113    try:
    1214        win_s = params['win_s']
    1315        samplerate = params['samplerate']
    1416        hop_s = params['hop_s']
    15     except:
     17    except KeyError:
    1618        """
    1719        # super fast
Note: See TracChangeset for help on using the changeset viewer.