ГОСТ Р 56047—2014
int GetMonoFrame(FILE signed int *. int, int):
int GetStereoFrame(FILE \ signed int *, signed int *, int. int);
int LevelPression{char *);
int Readlnt(FILE *. int);
void fata!err(char
/* Prototypes end V
Файл: getframe.c
«include <stdio.h>
«include <string.h>
«include <sldlib.h>
«include <getframe.h>
extern int ermo;
signed int
GetFrameValue(FILE *fp, int bytes)
{
int intvalue;
if (bytes <= 0)
return 0;
intvalue = Readlnt(fp. bytes);
switch(bytes) {
case 3:
if (intvalue & 0x00800000)
intvalue i= OxffOOOOOO;
break;
case 2;
if (intvalue & 0x00008000)
intvalue |= OxffffOOOO;
break;
case 1:
if (intvalue & 0x00000080)
intvalue |= OxffffffOO;
break;
}
return (signed int) intvalue;
}
int
GetMonoFrame(FILE *fp. signed int ‘vect. int bytes, int hann)
{
int i = 0;
if (fp == NULL)
return 0;
if (fseek(fp. (-hanrV2)*bytes. SEEK_CUR) == -1)
fatalerrCerr: %s”. strerrorferrno));
while(!feof(fp) && i < hann) {
vect[i] = GetFrameValue(fp. bytes);
i++:
}
if(i < hann) {
bzero(vecL hann*4);
fseek(fp. -i’bytes. SEEK_END):
return 0;
}
Г Number of samples wrote V
return i ;
}
72