compiling and decoding

master
mach327 2020-09-04 05:22:49 -04:00
parent fe8a362c56
commit ecd0f7143f
2 changed files with 5 additions and 3 deletions

View File

@ -26,3 +26,5 @@ $(BIN): $(OBJ)
%.o: %.c
$(CC) $(CFLAGS) -c $^ -o $@
run:
./m17_udp_listener 17000 | aplay -t raw -f S16_LE -r 8000 -c 1

6
main.c
View File

@ -172,11 +172,11 @@ int main(int argc, char *argv[])
//info
//fprintf(stderr,"%s\t\t%s\t\t%04X\n", packet.src, packet.dst, packet.type);
if(((type>>1)&0b11)==0b10) //voice only
if(((packet.type>>1)&0b11)==0b10) //voice only
{
//reconstruct speech
codec2_decode(cod, &speech_buff[0], packet->payload[0]);
codec2_decode(cod, &speech_buff[160], packet->payload[8]);
codec2_decode(cod, &speech_buff[0], &packet.payload[0]);
codec2_decode(cod, &speech_buff[160], &packet.payload[8]);
//send to stdout for playback
for(uint16_t i=0; i<320*2; i++)