Skip to content

Instantly share code, notes, and snippets.

@Katzenwerfer
Last active September 24, 2022 02:35
Show Gist options
  • Save Katzenwerfer/909faadec5a35872c3b5b23267229ad2 to your computer and use it in GitHub Desktop.
Save Katzenwerfer/909faadec5a35872c3b5b23267229ad2 to your computer and use it in GitHub Desktop.
Allow 120ms framesize on opusenc
diff --git a/src/opusenc.c b/src/opusenc.c
index 06838e5..8ae3c46 100644
--- a/src/opusenc.c
+++ b/src/opusenc.c
@@ -145,7 +145,7 @@ static void usage(void)
printf(" --speech Tune low bitrates for speech (override automatic detection)\n");
printf(" --comp n Set encoding complexity (0-10, default: 10 (slowest))\n");
printf(" --framesize n Set maximum frame size in milliseconds\n");
- printf(" (2.5, 5, 10, 20, 40, 60, default: 20)\n");
+ printf(" (2.5, 5, 10, 20, 40, 60, 120, default: 20)\n");
printf(" --expect-loss n Set expected packet loss in percent (default: 0)\n");
printf(" --downmix-mono Downmix to mono\n");
printf(" --downmix-stereo Downmix to stereo (if >2 channels)\n");
@@ -618,9 +618,10 @@ int main(int argc, char **argv)
else if (strcmp(optarg,"20")==0) opus_frame_param=OPUS_FRAMESIZE_20_MS;
else if (strcmp(optarg,"40")==0) opus_frame_param=OPUS_FRAMESIZE_40_MS;
else if (strcmp(optarg,"60")==0) opus_frame_param=OPUS_FRAMESIZE_60_MS;
+ else if (strcmp(optarg,"120")==0) opus_frame_param=OPUS_FRAMESIZE_120_MS;
else {
fatal("Invalid framesize: %s\n"
- "Value is in milliseconds and must be 2.5, 5, 10, 20, 40, or 60.\n",
+ "Value is in milliseconds and must be 2.5, 5, 10, 20, 40, 60 or 120.\n",
optarg);
}
frame_size = opus_frame_param <= OPUS_FRAMESIZE_40_MS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment