From b36179c7de27a74529a0e12ee64c03764e2690eb Mon Sep 17 00:00:00 2001 From: lxowalle Date: Mon, 6 Jan 2025 11:54:12 +0800 Subject: [PATCH] * fix sample rate&channel&format not set correctly --- components/voice/port/maixcam/maix_audio_mmf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/voice/port/maixcam/maix_audio_mmf.cpp b/components/voice/port/maixcam/maix_audio_mmf.cpp index af90f985..cfd8c295 100644 --- a/components/voice/port/maixcam/maix_audio_mmf.cpp +++ b/components/voice/port/maixcam/maix_audio_mmf.cpp @@ -838,8 +838,8 @@ namespace maix::audio // alsa init snd_pcm_t *handle = NULL; snd_pcm_hw_params_t *hwparams; - snd_pcm_format_t format_p = _alsa_format_from_maix(format); - err::check_bool_raise(0 <= _alsa_player_init(&handle, &hwparams, &_period_size, format_p, sample_rate, channel, 24000), "capture init failed"); + snd_pcm_format_t format_p = _alsa_format_from_maix(_format); + err::check_bool_raise(0 <= _alsa_player_init(&handle, &hwparams, &_period_size, format_p, _sample_rate, _channel, 24000), "capture init failed"); _handle = handle; snd_pcm_uframes_t buffer_size = 0; _buffer = _alsa_prepare_buffer(format_p, channel, _period_size, &buffer_size);