{"record":{"id":"4773fb76f5b418af","repo":"DrKLO/Telegram","slug":"usage-s-s-r-rate2-file1-sw-file2-sw-n","errorCode":null,"errorMessage":"Usage: %s [-s] [-r rate2] <file1.sw> <file2.sw>\\n","messagePattern":"Usage: (.+?) \\[-s\\] \\[-r rate2\\] <file1\\.sw> <file2\\.sw>\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"TMessagesProj/jni/opus/src/opus_compare.c","lineNumber":189,"sourceCode":"  float   *X;\n  float   *Y;\n  double    err;\n  float    Q;\n  size_t   xlength;\n  size_t   ylength;\n  size_t   nframes;\n  size_t   xi;\n  int      ci;\n  int      xj;\n  int      bi;\n  int      nchannels;\n  unsigned rate;\n  int      downsample;\n  int      ybands;\n  int      yfreqs;\n  int      max_compare;\n  if(_argc<3||_argc>6){\n    fprintf(stderr,\"Usage: %s [-s] [-r rate2] <file1.sw> <file2.sw>\\n\",\n     _argv[0]);\n    return EXIT_FAILURE;\n  }\n  nchannels=1;\n  if(strcmp(_argv[1],\"-s\")==0){\n    nchannels=2;\n    _argv++;\n  }\n  rate=48000;\n  ybands=NBANDS;\n  yfreqs=NFREQS;\n  downsample=1;\n  if(strcmp(_argv[1],\"-r\")==0){\n    rate=atoi(_argv[2]);\n    if(rate!=8000&&rate!=12000&&rate!=16000&&rate!=24000&&rate!=48000){\n      fprintf(stderr,\n       \"Sampling rate must be 8000, 12000, 16000, 24000, or 48000\\n\");\n      return EXIT_FAILURE;","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/DrKLO/Telegram/blob/45ab8f4308496e1f01026a97fcdb0d58a5274474/TMessagesProj/jni/opus/src/opus_compare.c#L171-L207","documentation":"Usage message from opus_compare's main(). Printed when _argc < 3 or _argc > 6 — the wrong number of arguments. Expected: opus_compare [-s] [-r rate2] <file1.sw> <file2.sw>, so 2 to 4 arguments plus the program name.","triggerScenarios":"_argc not in [3,6]. The two .sw files are mandatory; -s (stereo) and -r rate2 are optional. Fewer than 2 file args or more than 4 total optional+file args triggers it.","commonSituations":"Comparing only one file; passing extra flags the tool doesn't recognize; quoting errors collapsing multiple paths into one argument; running opus_compare with arguments meant for opusenc/opusdec.","solutions":["Provide exactly two .sw input files as the last arguments.","Use -s before the files for stereo, -r <rate> to set a non-48000 rate; each optional flag adds one arg.","Quote paths correctly so two files stay two arguments."],"exampleFix":"// before\n./opus_compare file1.sw\n\n// after\n./opus_compare file1.sw file2.sw\n# or with options:\n./opus_compare -s -r 16000 file1.sw file2.sw","handlingStrategy":"validation","validationCode":"// Validate argument count up front.\nif (_argc < 3 || _argc > 6) {\n    fprintf(stderr, \"Usage: %s [-s] [-r rate2] <file1.sw> <file2.sw>\\n\", _argv[0]);\n    return EXIT_FAILURE;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass exactly two .sw files as the last arguments.","Put optional -s and -r rate flags before the files.","Quote paths so they stay distinct arguments."],"tags":["cli","usage","arguments","opus","opus-compare","c"],"backgroundTag":null,"analyzedSha":"45ab8f4308496e1f01026a97fcdb0d58a5274474","analyzedAt":"2026-08-14T05:19:30.815Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}