From 66bfb73822ac2ee5bc672e79236773642dac8194 Mon Sep 17 00:00:00 2001 From: Tim Xia Date: Sat, 16 Mar 2024 17:11:45 -0400 Subject: [PATCH] fix error: use of undeclared identifier 'encodec_set_sample_rate' --- encodec.cpp | 6 +++++- encodec.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/encodec.cpp b/encodec.cpp index 5a014f5..9a2ae32 100644 --- a/encodec.cpp +++ b/encodec.cpp @@ -35,7 +35,7 @@ typedef enum { decode = 2, } encodec_run_mode; -void print_tensor(struct ggml_tensor * a) { +static void print_encodec_tensor(struct ggml_tensor * a) { float sum = 0; float maxv = -INFINITY; float minv = INFINITY; @@ -1446,3 +1446,7 @@ void encodec_free(struct encodec_context * ectx) { void encodec_set_target_bandwidth(struct encodec_context * ectx, int bandwidth) { ectx->model.hparams.bandwidth = bandwidth; } + +void encodec_set_sample_rate(struct encodec_context * ectx, int sample_rate) { + ectx->model.hparams.sr = sample_rate; +} \ No newline at end of file diff --git a/encodec.h b/encodec.h index fb3dc56..755e2b5 100644 --- a/encodec.h +++ b/encodec.h @@ -250,3 +250,5 @@ bool encodec_decompress_audio( */ void encodec_free( struct encodec_context * ectx); + +void encodec_set_sample_rate(struct encodec_context * ectx, int sample_rate); \ No newline at end of file