From c6e369e309a27917b902bc44f214f5bd6bbd7b90 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 14 Jan 2025 17:30:39 +0100 Subject: [PATCH] stm32-f4discovery-usb: add hal_audio_sink_get_frequency --- .../port/hal_audio_f4discovery.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/port/stm32-f4discovery-usb/port/hal_audio_f4discovery.c b/port/stm32-f4discovery-usb/port/hal_audio_f4discovery.c index aa0e64143..85ab8f54d 100644 --- a/port/stm32-f4discovery-usb/port/hal_audio_f4discovery.c +++ b/port/stm32-f4discovery-usb/port/hal_audio_f4discovery.c @@ -157,6 +157,17 @@ int16_t * hal_audio_sink_get_output_buffer(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 BSP_AUDIO_OUT_Init() to adjust the + * audio frequency. + */ +uint32_t hal_audio_sink_get_frequency(void) +{ + return sink_sample_rate; +} + /** * @brief Start stream */