File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -774,8 +774,22 @@ parse_audio_device() {
774774# There is passes PCM sample format while using ALSA tool (arecord)
775775# While using TinyALSA (tinycap -b) we need to convert PCM sample fomrat to bits.
776776extract_format_number () {
777- # (e.g., extracting '16' from 'S16_LE')
778- printf ' %s' " $1 " | grep ' [0-9]\+' -o
777+ local format_string=" $1 "
778+
779+ case " $format_string " in
780+ # Extract number for SXX_LE formats
781+ S[0-9]* _LE)
782+ printf ' %s' " $format_string " | grep ' [0-9]\+' -o
783+ ;;
784+ # Handle FLOAT format specifically
785+ FLOAT)
786+ printf ' 32' # Assuming 32-bit float
787+ ;;
788+ * )
789+ # Default or error handling for unsupported formats
790+ die " Unknown format"
791+ ;;
792+ esac
779793}
780794
781795# Initialize the parameters using for audio testing.
You can’t perform that action at this time.
0 commit comments