embedded: get audio sink frequency from hal_audio.h

This commit is contained in:
Matthias Ringwald 2025-01-14 17:17:34 +01:00
parent cad11d886b
commit adeab31f52
2 changed files with 10 additions and 1 deletions

View File

@ -158,7 +158,7 @@ static int btstack_audio_embedded_sink_init(
}
static uint32_t btstack_audio_embedded_sink_get_samplerate() {
return BSP_AUDIO_OUT_GetFrequency();
return hal_audio_sink_get_frequency();
}
static uint32_t source_samplerate = 0;

View File

@ -65,6 +65,15 @@ void hal_audio_sink_init(uint8_t channels,
uint32_t sample_rate,
void (*buffer_played_callback)(uint8_t buffer_index));
/**
* @brief Retrive the audio frequency.
* @retval AudioFreq: Audio frequency used to play the audio stream.
* @note This API should be called after the hal_audio_sink_init() to adjust the
* audio frequency.
*/
uint32_t hal_audio_sink_get_frequency(void);
/**
* @brief Get number of output buffers in HAL
* @returns num buffers