point to codec shield buffer

point to codec shield buffer

Postby benbiles » Wed Nov 18, 2015 4:28 pm

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...
benbiles
 
Posts: 2
Joined: Wed Nov 18, 2015 4:18 pm

Re: point to codec shield buffer

Postby guest » Thu Nov 19, 2015 12:59 pm

if you just want 16b signed -> 8b unsigned, do the following (byte = unsigned char)

byte output = (right_in >> 8) + 0x80;
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm


Return to Audio Codec Shield

Who is online

Users browsing this forum: No registered users and 1 guest


cron