Board index › Products › Audio Codec Shield

point to codec shield buffer

2 posts · 13702 views

point to codec shield buffer

by benbiles » Wed Nov 18, 2015 23:28 UTC
Hi ,

I am trying to convert signed int samples from the codec to unsigned char ( 8 bit ) for libltc

I'm using in the interupt but i think its too slow..

unsigned char samples = (right_in >> 8) & 0xff;
ltc_decoder_write (decoder, &samples, 1, 0);


I was looking at the Mods available in your codec but i'm not sure how to use them ?
how do I get the library / sketch to use MultiSU16X8toL16 ?

it would save time ? the libltc function i'm using requires a pointer to 'unsigned 8 bit char' samples buffer..

I tried,

int temp1;
int temp2;
MultiSU16X8toL16(temp1,temp2, &right_in); // can i use this multiplyer to get 8bit unsigned char ?
ltc_decoder_write (decoder, &temp1, 1, 0);

but i get errors...

Re: point to codec shield buffer

by guest » Thu Nov 19, 2015 19:59 UTC
if you just want 16b signed -> 8b unsigned, do the following (byte = unsigned char)

byte output = (right_in >> 8) + 0x80;