JvanKatwijk / dab-cmdline

DAB decoding library with example of its use
GNU General Public License v2.0
57 stars 29 forks source link

Problem in example 1 #92

Closed 1337Misom closed 1 year ago

1337Misom commented 1 year ago

Hi, I just wanted to mention you forgot to call set_audioChannel(theRadio,&ad); after dataforAudioService() in examples 1 and 2. Without it doesn't start the decoding process (at least with an rtlsdr).

JvanKatwijk commented 1 year ago

As far as I can see, the code reads if (run. load ()) { dataforAudioService (theRadio, programName. c_str (), &ad, 0); if (!ad. defined) { std::cerr << "sorry we cannot handle service " << programName << "\n"; run. store (false); } }

    if (run. load ()) {
       dabReset_msc (theRadio);
       set_audioChannel (theRadio, &ad);
    }

While the code guarded by the second condition could have been merged with the code guarded byh the first condition, it is clear that if (a) "run" is set to true, and the service is defined, the function "set_audioChannel" is called. So I am a little cofused by your statment, I just ran a test and it runs fine, with sound

Op zo 14 mei 2023 om 22:04 schreef 1337Misom @.***>:

Hi, I just wanted to mention you forgot to call set_audioChannel(theRadio,&ad); after dataforAudioService() in examples 1 and 2. Without it doesn't start the decoding process (at least with an rtlsdr).

— Reply to this email directly, view it on GitHub https://github.com/JvanKatwijk/dab-cmdline/issues/92, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCPHQHYTU73OFE42RCZKGDXGE3FNANCNFSM6AAAAAAYBLK5EY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Jan van Katwijk

1337Misom commented 1 year ago

The code you send would work ,but the one currently in the git doesn't include the if statement or any other form of calling set_audioChannel. It is correctly implemented in example 3.

JvanKatwijk commented 1 year ago

Then ther eis some miscommunication, this is the code - just extracted - from example 2 ikn the repository What code do you have, and whgere/how did you get/extract it

if (run. load ()) { dataforAudioService (theRadio, programName. c_str (), &ad, 0); if (!ad. defined) { std::cerr << "sorry we cannot handle service " << programName << "\n"; run. store (false); } }

if (run. load ()) { dabReset_msc (theRadio); set_audioChannel (theRadio, &ad); }

while (run. load () && (theDuration != 0)) { if (theDuration > 0) theDuration --; sleep (1); }

Op ma 15 mei 2023 om 10:59 schreef 1337Misom @.***>:

The code you send would work ,but the one currently in the git doesn't include the if statement or any other form of set_audioChannel

— Reply to this email directly, view it on GitHub https://github.com/JvanKatwijk/dab-cmdline/issues/92#issuecomment-1547458708, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCPHQBKL7KH2MSV2EKNBN3XGHV73ANCNFSM6AAAAAAYBLK5EY . You are receiving this because you commented.Message ID: @.***>

-- Jan van Katwijk

1337Misom commented 1 year ago

Okay then it only seems to be a problem in example 1

JvanKatwijk commented 1 year ago

You were right aaout example-1, it is adapted In my defence I can say that the examples are - as mentioned in different places -

anyway, thanlks for the tip and good luck

Op ma 15 mei 2023 om 11:31 schreef 1337Misom @.***>:

Okay then it only seems to be a problem in example 2

— Reply to this email directly, view it on GitHub https://github.com/JvanKatwijk/dab-cmdline/issues/92#issuecomment-1547508726, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCPHQHZ6UDCBYYPRYTT3BDXGHZXBANCNFSM6AAAAAAYBLK5EY . You are receiving this because you commented.Message ID: @.***>

-- Jan van Katwijk