m17_udp_listener decoding m17 traffic!
parent
6b650f6591
commit
f229557963
|
@ -3,3 +3,5 @@ Receives voice packets via UDP and allows to play them back using aplay.
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
./m17_udp | aplay -t raw -f S16_LE -r 8000 -c 1
|
./m17_udp | aplay -t raw -f S16_LE -r 8000 -c 1
|
||||||
|
or maybe
|
||||||
|
./m17_udp | aplay -t raw -f S16_BE -r 8000 -c 1
|
||||||
|
|
9
main.c
9
main.c
|
@ -107,7 +107,7 @@ int main(int argc, char *argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(rcv_len==15)
|
if(rcv_len==50)
|
||||||
{
|
{
|
||||||
uint64_t tmp;
|
uint64_t tmp;
|
||||||
tmp=(bits[0]<<(5*8))|(bits[1]<<(4*8))|(bits[2]<<(3*8))|(bits[3]<<(2*8))|(bits[4]<<(1*8))|bits[5];
|
tmp=(bits[0]<<(5*8))|(bits[1]<<(4*8))|(bits[2]<<(3*8))|(bits[3]<<(2*8))|(bits[4]<<(1*8))|bits[5];
|
||||||
|
@ -118,11 +118,10 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
//info
|
//info
|
||||||
printf("%s\t\t%s\t\t%04X\n", src, dst, type);
|
printf("%s\t\t%s\t\t%04X\n", src, dst, type);
|
||||||
|
size_t frame1_offset = 32, frame2_offset =frame1_offset+8;
|
||||||
/*
|
|
||||||
//reconstruct speech
|
//reconstruct speech
|
||||||
codec2_decode(cod, &speech_buff[0], &bits[0]);
|
codec2_decode(cod, &speech_buff[0], &bits[frame1_offset]);
|
||||||
codec2_decode(cod, &speech_buff[160], &bits[8]);
|
codec2_decode(cod, &speech_buff[160], &bits[frame2_offset]);
|
||||||
|
|
||||||
//send to stdout for playback
|
//send to stdout for playback
|
||||||
for(uint16_t i=0; i<320*2; i++)
|
for(uint16_t i=0; i<320*2; i++)
|
||||||
|
|
Loading…
Reference in New Issue