diff options
-rw-r--r-- | utils/tinyplay.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/tinyplay.c b/utils/tinyplay.c index d0c1e36..ea7e115 100644 --- a/utils/tinyplay.c +++ b/utils/tinyplay.c @@ -409,7 +409,8 @@ int play_sample(struct ctx *ctx) do { num_read = fread(buffer, 1, size, ctx->file); if (num_read > 0) { - if (pcm_writei(ctx->pcm, buffer, num_read) < 0) { + if (pcm_writei(ctx->pcm, buffer, + pcm_bytes_to_frames(ctx->pcm, num_read)) < 0) { fprintf(stderr, "error playing sample\n"); break; } |