diff --git a/c_src/xav/reader.c b/c_src/xav/reader.c index 9d8998b..7b75dc7 100644 --- a/c_src/xav/reader.c +++ b/c_src/xav/reader.c @@ -78,6 +78,9 @@ int reader_init(struct Reader *reader, unsigned char *path, size_t path_size, in #else av_opt_set_channel_layout(reader->swr_ctx, "in_channel_layout", reader->c->channel_layout, 0); av_opt_set_channel_layout(reader->swr_ctx, "out_channel_layout", reader->c->channel_layout, 0); + XAV_LOG_DEBUG("in_chlayout %ld", reader->c->channel_layout); + XAV_LOG_DEBUG("in nb_channels %d", + av_get_channel_layout_nb_channels(reader->c->channel_layout)); #endif av_opt_set_int(reader->swr_ctx, "in_sample_rate", reader->c->sample_rate, 0); diff --git a/test/fixtures/harvard.wav b/test/fixtures/harvard.wav new file mode 100644 index 0000000..b05ec79 Binary files /dev/null and b/test/fixtures/harvard.wav differ diff --git a/test/reader_test.exs b/test/reader_test.exs index 7ebc5d4..87365ec 100644 --- a/test/reader_test.exs +++ b/test/reader_test.exs @@ -45,7 +45,8 @@ defmodule Xav.ReaderTest do test "speech to text" do # This file has been downloaded from https://audio-samples.github.io/ # Section: Samples from the model without biasing or priming. - reader = Xav.Reader.new!("./test/fixtures/melnet_sample_0.mp3", read: :audio) + # reader = Xav.Reader.new!("./test/fixtures/melnet_sample_0.mp3", read: :audio) + reader = Xav.Reader.new!("./test/fixtures/harvard.wav", read: :audio) {:ok, whisper} = Bumblebee.load_model({:hf, "openai/whisper-tiny"}) {:ok, featurizer} = Bumblebee.load_featurizer({:hf, "openai/whisper-tiny"})