Changes in / [cc3f129:de9178e]


Ignore:
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • azure-pipelines.yml

    rcc3f129 rde9178e  
    11#  configuration file for azure continuous integration
    22jobs:
    3 
    43- job: linux
    54  pool:
    65    vmImage: 'Ubuntu 16.04'
     6
    77  steps:
    88  - script: |
    99      make
    1010    displayName: 'make'
    11     env:
    12       CFLAGS: -Werror
    13 
    1411- job: windows
    1512  pool:
    1613    vmIMage: 'VS2017-Win2016'
     14
    1715  steps:
    1816  - script: |
     
    2624  pool:
    2725    vmIMage: macOS-10.13
     26
    2827  steps:
    2928  - script: |
     
    3534      make
    3635    displayName: 'make'
    37     env:
    38       CFLAGS: -Werror
  • doc/about.rst

    rcc3f129 rde9178e  
    6060-------
    6161
    62 aubio is a `free <https://www.debian.org/intro/free>`_ and `open source
     62aubio is a `free <http://www.debian.org/intro/free>`_ and `open source
    6363<http://www.opensource.org/docs/definition.php>`_ software; **you** can
    6464redistribute it and/or modify it under the terms of the `GNU
  • doc/aubiomfcc.txt

    rcc3f129 rde9178e  
    5252  url:
    5353
    54   https://engineering.purdue.edu/~malcolm/interval/1998-010/ (see file mfcc.m)
     54  http://cobweb.ecn.purdue.edu/~malcolm/interval/1998-010/ (see file mfcc.m)
    5555
    5656SEE ALSO
  • doc/conf.py

    rcc3f129 rde9178e  
    4646# General information about the project.
    4747project = u'aubio'
    48 copyright = u'2018, Paul Brossier'
     48copyright = u'2016, Paul Brossier'
    4949
    5050# The version info for the project you're documenting, acts as replacement for
  • doc/python_module.rst

    rcc3f129 rde9178e  
    8080.. _demo_filter.py: https://github.com/aubio/aubio/blob/master/python/demos/demo_filter.py
    8181.. _python tests: https://github.com/aubio/aubio/blob/master/python/tests
     82
  • python/ext/aubiomodule.c

    rcc3f129 rde9178e  
    118118  smpl_t output;
    119119
    120   if (!PyArg_ParseTuple (args,
    121         "" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR,
    122         &input, &samplerate, &fftsize)) {
     120  if (!PyArg_ParseTuple (args, "|" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR , &input, &samplerate, &fftsize)) {
    123121    return NULL;
    124122  }
     
    135133  smpl_t output;
    136134
    137   if (!PyArg_ParseTuple (args,
    138         "" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR,
    139         &input, &samplerate, &fftsize)) {
     135  if (!PyArg_ParseTuple (args, "|" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR , &input, &samplerate, &fftsize)) {
    140136    return NULL;
    141137  }
     
    152148  smpl_t output;
    153149
    154   if (!PyArg_ParseTuple (args,
    155         "" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR,
    156         &input, &samplerate, &fftsize)) {
     150  if (!PyArg_ParseTuple (args, "|" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR, &input, &samplerate, &fftsize)) {
    157151    return NULL;
    158152  }
     
    169163  smpl_t output;
    170164
    171   if (!PyArg_ParseTuple (args,
    172         "" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR,
    173         &input, &samplerate, &fftsize)) {
     165  if (!PyArg_ParseTuple (args, "|" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR, &input, &samplerate, &fftsize)) {
    174166    return NULL;
    175167  }
  • python/ext/py-filterbank.c

    rcc3f129 rde9178e  
    9595  if (self->vec.length != self->win_s / 2 + 1) {
    9696    PyErr_Format(PyExc_ValueError,
    97                  "input cvec has length %d, but filterbank expects length %d",
     97                 "input cvec has length %d, but fft expects length %d",
    9898                 self->vec.length, self->win_s / 2 + 1);
    9999    return NULL;
     
    140140  if (err > 0) {
    141141    PyErr_SetString (PyExc_ValueError,
    142         "error when running set_triangle_bands");
     142        "error when setting filter to A-weighting");
    143143    return NULL;
    144144  }
     
    159159  if (err > 0) {
    160160    PyErr_SetString (PyExc_ValueError,
    161         "error when running set_mel_coeffs_slaney");
     161        "error when setting filter to A-weighting");
    162162    return NULL;
    163163  }
  • python/lib/aubio/cmd.py

    rcc3f129 rde9178e  
    248248                action = "store", dest = "cut_until_nslices", default = None,
    249249                help="how many extra slices should be added at the end of each slice")
    250         self.add_argument("--create-first",
    251                 action = "store_true", dest = "create_first", default = False,
    252                 help="always include first slice")
    253250
    254251# some utilities
     
    503500def main():
    504501    parser = aubio_parser()
    505     if sys.version_info[0] != 3:
    506         # on py2, create a dummy ArgumentParser to workaround the
    507         # optional subcommand issue. See https://bugs.python.org/issue9253
    508         # This ensures that:
    509         #  - version string is shown when only '-V' is passed
    510         #  - help is printed if  '-V' is passed with any other argument
    511         #  - any other argument get forwarded to the real parser
    512         parser_root = argparse.ArgumentParser(add_help=False)
    513         parser_root.add_argument('-V', '--version', help="show version",
    514                 action="store_true", dest="show_version")
    515         args, extras = parser_root.parse_known_args()
    516         if args.show_version == False: # no -V, forward to parser
    517             args = parser.parse_args(extras, namespace=args)
    518         elif len(extras) != 0: # -V with other arguments, print help
    519             parser.print_help()
    520             sys.exit(1)
    521     else: # in py3, we can simply use parser directly
    522         args = parser.parse_args()
     502    args = parser.parse_args()
    523503    if 'show_version' in args and args.show_version:
    524504        sys.stdout.write('aubio version ' + aubio.version + '\n')
  • python/lib/aubio/cut.py

    rcc3f129 rde9178e  
    102102    s = source(source_uri, samplerate, hopsize)
    103103    if samplerate == 0:
    104         samplerate = s.samplerate
     104        samplerate = s.get_samplerate()
    105105        options.samplerate = samplerate
    106106
     
    151151                timestamps, timestamps_end = timestamps_end,
    152152                output_dir = options.output_directory,
    153                 samplerate = options.samplerate,
    154                 create_first = options.create_first)
     153                samplerate = options.samplerate)
    155154
    156155def main():
  • python/lib/aubio/slicing.py

    rcc3f129 rde9178e  
    77
    88def slice_source_at_stamps(source_file, timestamps, timestamps_end=None,
    9                            output_dir=None, samplerate=0, hopsize=256,
    10                            create_first=False):
     9                           output_dir=None, samplerate=0, hopsize=256):
    1110    """ slice a sound file at given timestamps """
    1211
     
    1413        raise ValueError("no timestamps given")
    1514
    16     if timestamps[0] != 0 and create_first:
     15    if timestamps[0] != 0:
    1716        timestamps = [0] + timestamps
    1817        if timestamps_end is not None:
     
    2019
    2120    if timestamps_end is not None:
    22         if len(timestamps_end) == len(timestamps) - 1:
    23             timestamps_end = timestamps_end + [_max_timestamp]
    24         elif len(timestamps_end) != len(timestamps):
     21        if len(timestamps_end) != len(timestamps):
    2522            raise ValueError("len(timestamps_end) != len(timestamps)")
    2623    else:
     
    5249        vec, read = _source.do_multi()
    5350        # if the total number of frames read will exceed the next region start
    54         while len(regions) and total_frames + read >= regions[0][0]:
     51        if len(regions) and total_frames + read >= regions[0][0]:
    5552            #print "getting", regions[0], "at", total_frames
    5653            # get next region
     
    7976                    # write remaining samples from current region
    8077                    _sink.do_multi(vec[:, start:remaining], remaining - start)
    81                     #print("closing region", "remaining", remaining)
     78                    #print "closing region", "remaining", remaining
    8279                    # close this file
    8380                    _sink.close()
     
    8683                _sink.do_multi(vec[:, start:read], read - start)
    8784        total_frames += read
    88         # remove old slices
    89         slices = list(filter(lambda s: s['end_stamp'] > total_frames,
    90             slices))
    9185        if read < hopsize:
    9286            break
  • python/tests/test_aubio_cmd.py

    rcc3f129 rde9178e  
    2020
    2121    def test_samples2seconds(self):
    22         self.assertEqual(aubio.cmd.samples2seconds(3200, 32000),
    23                 "0.100000\t")
     22        self.assertEqual(aubio.cmd.samples2seconds(3200, 32000), "0.100000\t")
    2423
    2524    def test_samples2milliseconds(self):
    26         self.assertEqual(aubio.cmd.samples2milliseconds(3200, 32000),
    27                 "100.000000\t")
     25        self.assertEqual(aubio.cmd.samples2milliseconds(3200, 32000), "100.000000\t")
    2826
    2927    def test_samples2samples(self):
    30         self.assertEqual(aubio.cmd.samples2samples(3200, 32000),
    31                 "3200\t")
     28        self.assertEqual(aubio.cmd.samples2samples(3200, 32000), "3200\t")
    3229
    3330if __name__ == '__main__':
  • python/tests/test_slicing.py

    rcc3f129 rde9178e  
    2424    def test_slice_start_only_no_zero(self):
    2525        regions_start = [i*1000 for i in range(1, n_slices)]
    26         slice_source_at_stamps(self.source_file, regions_start,
    27                 output_dir = self.output_dir, create_first=True)
     26        slice_source_at_stamps(self.source_file, regions_start, output_dir = self.output_dir)
    2827
    2928    def test_slice_start_beyond_end(self):
    3029        regions_start = [i*1000 for i in range(1, n_slices)]
    3130        regions_start += [count_samples_in_file(self.source_file) + 1000]
    32         slice_source_at_stamps(self.source_file, regions_start,
    33                 output_dir = self.output_dir, create_first=True)
     31        slice_source_at_stamps(self.source_file, regions_start, output_dir = self.output_dir)
    3432
    3533    def test_slice_start_every_blocksize(self):
    3634        hopsize = 200
    37         regions_start = [i*hopsize for i in range(0, n_slices)]
     35        regions_start = [i*hopsize for i in range(1, n_slices)]
    3836        slice_source_at_stamps(self.source_file, regions_start, output_dir = self.output_dir,
    3937                hopsize = 200)
    40 
    41     def test_slice_start_every_half_blocksize(self):
    42         hopsize = 200
    43         regions_start = [i*hopsize//2 for i in range(0, n_slices)]
    44         slice_source_at_stamps(self.source_file, regions_start,
    45                 output_dir = self.output_dir, hopsize = 200)
    4638
    4739    def tearDown(self):
     
    10092            "number of samples written different from number of original samples")
    10193
    102     def test_slice_start_and_ends_with_missing_end(self):
    103         regions_start = [i*1000 for i in range(n_slices)]
    104         regions_ends = [r-1 for r in regions_start[1:]]
    105         slice_source_at_stamps(self.source_file, regions_start, regions_ends,
    106                 output_dir = self.output_dir)
    107         written_samples = count_samples_in_directory(self.output_dir)
    108         original_samples = count_samples_in_file(self.source_file)
    109         total_files = count_files_in_directory(self.output_dir)
    110         assert_equal(n_slices, total_files,
    111             "number of slices created different from expected")
    112         assert_equal(written_samples, original_samples,
    113             "number of samples written different from number of original samples")
    114 
    11594    def tearDown(self):
    11695        shutil.rmtree(self.output_dir)
     
    155134        regions_end = None
    156135        slice_source_at_stamps (self.source_file, regions_start, regions_end,
    157                 output_dir = self.output_dir, create_first=True)
     136                output_dir = self.output_dir)
    158137        total_files = count_files_in_directory(self.output_dir)
    159138        assert_equal(n_slices, total_files,
  • src/io/source_avcodec.c

    rcc3f129 rde9178e  
    453453    goto beach;
    454454  }
    455 #else
    456 #warning "avutil < 53 is deprecated, crashes might occur on corrupt files"
    457455#endif
    458456
  • src/spectral/filterbank_mel.h

    rcc3f129 rde9178e  
    5959
    6060  The filter coefficients are built according to Malcolm Slaney's Auditory
    61   Toolbox, available online at the following address (see file mfcc.m):
    62 
    63   https://engineering.purdue.edu/~malcolm/interval/1998-010/
     61  Toolbox, available at http://engineering.purdue.edu/~malcolm/interval/1998-010/
     62  (see file mfcc.m).
    6463
    6564*/
  • src/spectral/mfcc.h

    rcc3f129 rde9178e  
    2727
    2828  The implementation follows the specifications established by Malcolm Slaney
    29   in its Auditory Toolbox, available online at the following address (see
    30   file mfcc.m):
     29  in its Auditory Toolbox, available online (see file mfcc.m).
    3130
    32   https://engineering.purdue.edu/~malcolm/interval/1998-010/
     31  http://engineering.ecn.purdue.edu/~malcolm/interval/1998-010/
    3332
    3433  \example spectral/test-mfcc.c
  • src/spectral/phasevoc.c

    rcc3f129 rde9178e  
    213213    synthold[i] += synth[i + pv->hop_s] * pv->scale;
    214214}
    215 
    216 uint_t aubio_pvoc_get_win(aubio_pvoc_t* pv)
    217 {
    218   return pv->win_s;
    219 }
    220 
    221 uint_t aubio_pvoc_get_hop(aubio_pvoc_t* pv)
    222 {
    223   return pv->hop_s;
    224 }
  • src/spectral/phasevoc.h

    rcc3f129 rde9178e  
    8989*/
    9090uint_t aubio_pvoc_get_win(aubio_pvoc_t* pv);
    91 
    9291/** get hop size
    9392
  • src/synth/wavetable.c

    rcc3f129 rde9178e  
    165165  aubio_wavetable_set_amp (s, 0.);
    166166  //s->last_pos = 0;
    167   return aubio_wavetable_set_playing (s, 0);
     167  return aubio_wavetable_set_playing (s, 1);
    168168}
    169169
  • src/synth/wavetable.h

    rcc3f129 rde9178e  
    5151*/
    5252aubio_wavetable_t * new_aubio_wavetable(uint_t samplerate, uint_t hop_size);
     53
     54/** load source in wavetable
     55
     56  \param o wavetable, created by new_aubio_wavetable()
     57  \param uri the uri of the source to load
     58
     59  \return 0 if successful, non-zero otherwise
     60
     61*/
     62uint_t aubio_wavetable_load( aubio_wavetable_t * o, const char_t * uri );
    5363
    5464/** process wavetable function
Note: See TracChangeset for help on using the changeset viewer.