Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using libtlc with NDK in an Android App: unsigned char and ltcsnd_sample_t representation #33

Open
niklasdahlheimer opened this issue Mar 21, 2018 · 2 comments

Comments

@niklasdahlheimer
Copy link

hey guys,

I'm trying to use libltc in an android app (for wireless ltc-distribution). Do you have any experiences about that?

First thing I stumbled over is that the NDK seems to interpret the unsigned chars of SMPTETimecode-Object in a strange way. If I assign the time like in the libtlc-example:

my_timecode.years =18; my_timecode.months =3; my_timecode.days =18;

the debugger tells me that
years = {unsigned char} '\x12' months = {unsigned char} '\x03' days = {unsigned char} '\x12'

So I changed the assignment to
my_timecode.years ='18'; my_timecode.months ='3'; my_timecode.days ='18';

Second thing, and I'm not sure if this is the consequence of the issue above, is that the encoded timecode looks like that:

"������������������������+&&&&&&&&&&&&&&&&&&&&&&+������������+&&&&&&&&&&+������������������������+&&&&&&&&&&&&&&&&&&&&&&+������������+&&&&&&&&&&+������������+&&&&&&&&&&+������������������������+&&&&&&&&&&&&&&&&&&&&&&+������������+&&&&&&&&&&+������������������������+&&&&&&&&&&&&&&&&&&&&&&+������������+&&&&&&&&&&+������������������������+&&&&&&&&&&+������������+&&&&&&&&&&&&&&&&&&&&&&+������������������������+&&&&&&&&&&&&&&&&&&&&&&+������������������������+&&&&&&&&&&+������������+&&&&&&&&&&+������������+&&&&&&&&&&&&&&&&&&&&&&+������������������������+&&&&&&&&&&&&&&&&&&&&&&+������������������������+&&&&&&&&&&&&&&&&&&&&&&+������������+&&&&&&&&&&+������������������������+&&&&&&&&&&+������������+&&&&&&&&&&&&&&&&&&&&&&+������������+&&&&&&&&&&+������������������������+&&&&&&&&&&&&&&&&&&&&&&+������������������������+&&&&&&&&&&&&&&&&&&&&&&+������������+&&&&&&&&&&+������������������������+&&&&&&&&&&+������������+&&&&&&&&&&+������������+&&&&&&&&&&&&&&&&&&&&&&+������������������������+&&&&&&&&&&&&&&&&&&&&&&+������������+&&&"...

which isn't a legal timecode, right? Or is this a way of representing data of the ltcsnd_sample_t-object?

Looking forward to hear from you!
Greetings from cologne/germany.

image

@niklasdahlheimer
Copy link
Author

niklasdahlheimer commented Apr 6, 2018

Nobody has an idea? I really need to get this forward for an university-project. A hint in which direction I can investigate this issue, would be great.

@x42
Copy link
Owner

x42 commented Apr 6, 2018

It likely is proper 8bit unsigned int audio-data (uint8_t). -- Just don't read it as a string. It's a raw audio buffer, not text.

But the pattern looks about correct. LTC is a square wave, so an alternating pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants