aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils/tinyplay.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/utils/tinyplay.c b/utils/tinyplay.c
index 4f603ee..2689158 100644
--- a/utils/tinyplay.c
+++ b/utils/tinyplay.c
@@ -58,10 +58,10 @@ void cmd_init(struct cmd *cmd)
cmd->config.channels = 2;
cmd->config.rate = 48000;
cmd->config.format = PCM_FORMAT_S16_LE;
- cmd->config.silence_threshold = 1024 * 2;
+ cmd->config.silence_threshold = cmd->config.period_size * cmd->config.period_count;
cmd->config.silence_size = 0;
- cmd->config.stop_threshold = 1024 * 2;
- cmd->config.start_threshold = 1024;
+ cmd->config.stop_threshold = cmd->config.period_size * cmd->config.period_count;
+ cmd->config.start_threshold = cmd->config.period_size;
cmd->bits = 16;
}
@@ -318,6 +318,10 @@ int main(int argc, char **argv)
cmd.filetype++;
}
+ cmd.config.silence_threshold = cmd.config.period_size * cmd.config.period_count;
+ cmd.config.stop_threshold = cmd.config.period_size * cmd.config.period_count;
+ cmd.config.start_threshold = cmd.config.period_size;
+
if (ctx_init(&ctx, &cmd) < 0) {
return EXIT_FAILURE;
}