mirror of
https://github.com/JvanKatwijk/dab-cmdline
synced 2025-10-05 15:42:46 +02:00
Example 2 Example 2 is a simple command line version of the DAB software. The input device is fixed, depending on a setting in the CMakeLists.txt file. The output is either to the soundcard (default) or to a file (-O option). Other than example 1, it binds directly to the functionality implementing the DAB decoding. All callbacks are defined, most of them with an empty body. See the file main.cpp for the command line options Feel free to improve the program Points to note: 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). Sound output now is written in PCM format, i.e. a regular wav file ========================================================================== Example-2 and TII data ---------------------------------------------------------------------------- Eample 2 is now equipped with a handler for decoding TII data. In the current setup the handler starts when a selected audio service starts. On startup of the handler, it will look for a database with names and other data for the various transmitters. Note that on an X64 Linux PC (and under Windows) a separate program exists to download a copy of the database. For e.g. RPI based system, there is no (not yet?) such a separate program to download a copy of the database. However, a reasonably recent copy of the database can be downloaded from the Qt-DAB repository. The directory "helpers" (I am dutch so I use from time to time dutch words) one sees a file "tiiFile.zip". Download that file to the home directory and unzip. It will create a file ".tiiFile.tii", i.e. the database being looked for by the program. In the current setup the tii handler will for each transmitter detected print a line EId mainId subId -> country channel ensemble transmitter latitude longitude (power altitude height) This is currently Work in Progress, feel free to suggest enhancements