1
0
mirror of https://github.com/JvanKatwijk/dab-cmdline synced 2025-10-05 15:42:46 +02:00
Files
2025-09-19 11:00:33 +02:00
..
2017-09-27 12:58:08 +02:00
2017-09-27 12:58:08 +02:00
2025-09-19 11:00:33 +02:00
2025-06-24 20:49:38 +02:00
2021-08-23 19:39:05 +02:00
2017-09-27 12:58:08 +02:00

Example 4

This is example 4, a simple program, not using the library, but binding directly
to the functions implementing the dab decoding.
All callbacks are defined, most of them with an empty body.

In this version the aac or mp2 decoding is NOT done in the library,
rather, the MP2 resp. AAC frames are emitted through stdout,
using the function frameHandler.

See the file main.cpp for the command line options

Feel free to improve the program

Points to note:

I added a '-f' flag, -f filename. If specified the frames will be
written to the file specified.

bytesOut is a new callback function, a function that is called
from the tdc handler (and later may be from others as well)

The data parameter is a packet with a 4 byte header
byte 0 is 0xFF
byte 1 is 0x00
byte 2 is 0xFF
byte 3 is 0x00
byte 4 is the high byte of the 16 bit size
byte 5 is the low  byte of the 16 bit size
byte 6 is 0x00
byte 7 is 0 for packet type 0, 0xFF for packet type 1

Note that the length is the length of the data part, so not taking the
header into account

The bytesOut function puts the data into a simple TCP server that can be 
read from port 8888 (depending on the configuration).