Data-Over-Voice
[lcr.git] / alawulaw.c
index 07d5351..cafe1af 100644 (file)
@@ -9,10 +9,11 @@
 **                                                                           **
 \*****************************************************************************/ 
 
-signed long *audio_law_to_s32;
+signed int *audio_law_to_s32;
+unsigned char silence;
 
 /* ulaw -> signed 16-bit */
-static signed long audio_ulaw_to_s32[] =
+static signed int audio_ulaw_to_s32[] =
 {
        0xffff8284, 0xffff8684, 0xffff8a84, 0xffff8e84,
        0xffff9284, 0xffff9684, 0xffff9a84, 0xffff9e84,
@@ -81,7 +82,7 @@ static signed long audio_ulaw_to_s32[] =
 };
 
 /* alaw -> signed 16-bit */
-static signed long audio_alaw_to_s32[] =
+static signed int audio_alaw_to_s32[] =
 {
        0x000013fc, 0xffffec04, 0x00000144, 0xfffffebc,
        0x0000517c, 0xffffae84, 0x0000051c, 0xfffffae4,
@@ -228,8 +229,8 @@ void generate_tables(char law)
 {
        int i, j;
 
-       if (law == 'a')
-       {
+       if (law == 'a') {
+               silence = 0x2a;
                audio_law_to_s32=audio_alaw_to_s32;
                /* generating alaw-table */
                i = j = 0;
@@ -242,8 +243,8 @@ void generate_tables(char law)
                                 = audio_alaw_relations[(j<<1)|1];
                        i++;
                }
-       } else
-       {
+       } else {
+               silence = 0xff;
                audio_law_to_s32=audio_ulaw_to_s32;
                /* generating ulaw-table */
                i = j = 0;