diff --git a/platform/embedded/btstack_audio_embedded.c b/platform/embedded/btstack_audio_embedded.c index 8d6d097d4..ddda28894 100644 --- a/platform/embedded/btstack_audio_embedded.c +++ b/platform/embedded/btstack_audio_embedded.c @@ -83,8 +83,7 @@ static void driver_timer_handler_sink(btstack_timer_source_t * ts){ // playback buffer ready to fill if (output_buffer_to_play != output_buffer_to_fill){ - // fill buffer - int16_t * buffer = hal_audio_get_output_buffer(output_buffer_to_fill); + int16_t * buffer = hal_audio_sink_get_output_buffer(output_buffer_to_fill); (*playback_callback)(buffer, output_buffer_samples); // next @@ -114,8 +113,7 @@ static int btstack_audio_embedded_sink_init( playback_callback = playback; - // TODO: split HAL Audio API as well - hal_audio_init(channels, samplerate, &btstack_audio_audio_played, NULL); + hal_audio_sink_init(channels, samplerate, &btstack_audio_audio_played); return 0; } @@ -134,13 +132,13 @@ static int btstack_audio_embedded_source_init( static void btstack_audio_embedded_sink_start_stream(void){ - output_buffer_count = hal_audio_get_num_output_buffers(); - output_buffer_samples = hal_audio_get_num_output_buffer_samples(); + output_buffer_count = hal_audio_sink_get_num_output_buffers(); + output_buffer_samples = hal_audio_sink_get_num_output_buffer_samples(); // pre-fill HAL buffers uint16_t i; for (i=0;i 1 frame - 16 bit/stereo = 4 bytes BSP_AUDIO_OUT_Play( (uint16_t*) output_buffer, NUM_OUTPUT_BUFFERS * OUTPUT_BUFFER_NUM_SAMPLES * 4); @@ -144,7 +142,7 @@ void hal_audio_start(void){ /** * @brief Close audio codec */ -void hal_audio_close(void){ +void hal_audio_sink_close(void){ started = 0; BSP_AUDIO_OUT_Stop(CODEC_PDWN_HW); }