Changeset 75a0f40


Ignore:
Timestamp:
Sep 22, 2009, 5:37:36 PM (15 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:
2062e48
Parents:
55b7cb4
Message:

examples/utils.c: add --bufsize option and short message when option parsing went wrong (should never happen)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/utils.c

    r55b7cb4 r75a0f40  
    105105                        "       -s      --silence       Select silence threshold.\n"
    106106                        "       -p      --pitch         Select pitch detection algorithm.\n"
     107                        "       -B      --bufsize       Set buffer size.\n"
    107108                        "       -H      --hopsize       Set hopsize.\n"
    108109                        "       -a      --averaging     Use averaging.\n"
     
    112113
    113114int parse_args (int argc, char **argv) {
    114         const char *options = "hvjo:i:O:t:s:p:H:a";
     115        const char *options = "hvjo:i:O:t:s:p:B:H:a";
    115116        int next_option;
    116117        struct option long_options[] =
     
    126127                {"pitch"    , 1, NULL, 'p'},
    127128                {"averaging", 0, NULL, 'a'},
     129                {"bufsize",   1, NULL, 'B'},
    128130                {"hopsize",   1, NULL, 'H'},
    129131                {NULL       , 0, NULL, 0}
     
    212214                                averaging = 1;
    213215                                break;
     216                        case 'B':
     217                                buffer_size = atoi(optarg);
     218                                break;
    214219                        case 'H':
    215220                                overlap_size = atoi(optarg);
     
    221226                                break;
    222227                        default: /*something else unexpected */
     228                                fprintf(stderr, "Error parsing option '%c'\n", next_option);
    223229                                abort ();
    224230                }
Note: See TracChangeset for help on using the changeset viewer.