@@ -1646,40 +1646,31 @@ static int cmd_file_select(const struct shell *shell, size_t argc, char **argv)
16461646 struct bt_audio_codec_cfg * codec_cfg =
16471647 & broadcast_param [big_index ].subgroups [sub_index ].group_lc3_preset .codec_cfg ;
16481648
1649- int freq_hz = 0 ;
1649+ struct lc3_stream_cfg cfg ;
16501650
1651- ret = le_audio_freq_hz_get (codec_cfg , & freq_hz );
1651+ ret = le_audio_freq_hz_get (codec_cfg , & cfg . sample_rate_hz );
16521652 if (ret ) {
16531653 shell_error (shell , "Failed to get frequency: %d" , ret );
16541654 return ret ;
16551655 }
16561656
1657- int frame_duration = 0 ;
1658-
1659- ret = le_audio_duration_us_get (codec_cfg , & frame_duration );
1657+ ret = le_audio_duration_us_get (codec_cfg , & cfg .frame_duration_us );
16601658 if (ret ) {
16611659 shell_error (shell , "Failed to get frame duration: %d" , ret );
16621660 }
16631661
1664- uint32_t bit_rate = 0 ;
1665-
1666- ret = le_audio_bitrate_get (codec_cfg , & bit_rate );
1662+ ret = le_audio_bitrate_get (codec_cfg , & cfg .bit_rate_bps );
16671663 if (ret ) {
16681664 shell_error (shell , "Failed to get bitrate: %d" , ret );
16691665 }
16701666
1671- struct lc3_stream_cfg cfg = {
1672- .sample_rate_hz = freq_hz ,
1673- .bit_rate_bps = bit_rate ,
1674- .frame_duration_us = frame_duration ,
1675- };
1676-
1677- /* Verify the file header */
1667+ /* Verify that the file header matches the stream configurationn */
16781668 /* NOTE: This will not abort the streamer if the file is not valid, only give a warning */
1679- bool result = lc3_streamer_file_header_verify (file_name , & cfg );
1669+ bool header_valid = lc3_streamer_file_compatible_check (file_name , & cfg );
16801670
1681- if (!result ) {
1682- shell_warn (shell , "File header verification failed, continue at own risk" );
1671+ if (!header_valid ) {
1672+ shell_warn (shell , "File header verification failed. File may not be compatible "
1673+ "with stream config." );
16831674 }
16841675
16851676 ret = lc3_streamer_stream_register (
0 commit comments