hopefully final fix

pull/15/head
Wojciech Kaczmarski 2023-09-27 19:20:29 +03:00
rodzic 0c83484dce
commit 2c21bfbabf
1 zmienionych plików z 1 dodań i 4 usunięć

Wyświetl plik

@ -15,11 +15,8 @@ str=$4
#get the size in bytes
len=$(echo -n "$str" | wc -c) #get UTF-8 encoded length in bytes
len=$((len+2)) #add 2 additional bytes (0x05 and 0x00)
len_chars=${#str} #get length in characters rather than bytes
#echo the message to the encoder
str1=${str:0:$((len_chars-1))}
str2=${str: -1}
echo -en "\x05"$str1$str2"\x00" | m17-packet-encode -S $2 -D $1 -C $3 -n $len -o $5
echo -en '\x05'$str'\x00' | m17-packet-encode -S $2 -D $1 -C $3 -n $len -o $5
sox -t raw -r 48000 -b 16 -c 1 -L -e signed-integer $5 $5".wav"