1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865
|
/****************************************************************************
DRC: Digital Room Correction
Copyright (C) 2002, 2003 Denis Sbragion
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
You can contact the author on Internet at the following address:
d.sbragion@infotecna.it
****************************************************************************/
/* Funzioni di libreria base */
/* Inclusioni */
#include "baselib.h"
#include "fft.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/* Memory leaks debugger */
#ifdef DebugMLeaks
#include "debug_new.h"
#endif
/* Output stringhe con sync output e parametro */
int sputsp(const char * s, const char * p)
{
int Res;
if (p == NULL)
Res = puts(s);
else
Res = printf("%s%s\n",s,p);
fflush(stdout);
return(Res);
}
/* Output stringhe con sync output */
int sputs(const char * s)
{
return(sputsp(s, NULL));
}
/* Determina la lunghezza di un file */
size_t FSize(FILE * F)
{
long CPos;
long FS;
CPos = ftell(F);
fseek(F,0,SEEK_END);
FS = ftell(F);
fseek(F,CPos,SEEK_SET);
return (size_t) FS;
}
/* Legge parte di un file di ingresso e lo pone nell'array indicato
di dimensione InitWindow.
Ritorna true se l'operazione ha successo.
*/
Boolean ReadSignal(const char * FName,DRCFloat * Dst,const int InitWindow,
const int ImpulseCenter,const IFileType FType,
int * PreSpikeStart, int * PostSpikeEnd)
{
int I;
int IStart;
int IEnd;
int WHalf;
DRCFileDouble RWD;
DRCFileFloat RWF;
DRCFileInt RWI;
int RWDim;
/* File gestione IO */
FILE * IOF;
long FS;
/* Azzera l'array destinazione */
for (I = 0;I < InitWindow;I++)
Dst[I] = 0;
/* Salva la dimensione del blocco lettura */
RWDim = sizeof(DRCFileFloat);
switch (FType)
{
case PcmFloat64Bit:
RWDim = sizeof(DRCFileDouble);
break;
case PcmFloat32Bit:
RWDim = sizeof(DRCFileFloat);
break;
case PcmInt16Bit:
RWDim = sizeof(DRCFileInt);
break;
}
/* Apre il file di input */
if ((IOF = fopen(FName,"rb")) == NULL)
{
perror("\nUnable to open input file");
return False;
}
/* Recupera la dimensione del file */
FS = FSize(IOF) / RWDim;
/* Controllo validit parametri */
if (FS == 0)
{
puts("\nInput file is zero length.");
return False;
}
if (ImpulseCenter > FS)
{
puts("\nImpulseCenter is out of input file range.");
return False;
}
/* Calcolo la posizione centrale finestra */
if (InitWindow % 2 == 0)
WHalf = (InitWindow - 1) / 2;
else
WHalf = InitWindow / 2;
/* Calcola gli estremi lettura finestra */
if (ImpulseCenter > WHalf)
{
if (fseek(IOF,(ImpulseCenter - WHalf) * RWDim,SEEK_SET) != 0)
{
perror("\nError reading input file");
return False;
}
IStart = 0;
if (InitWindow > FS - (ImpulseCenter - WHalf))
IEnd = FS - (ImpulseCenter - WHalf);
else
IEnd = InitWindow;
}
else
{
IStart = WHalf - ImpulseCenter;
if (InitWindow > IStart + FS)
IEnd = IStart + FS;
else
IEnd = InitWindow;
}
/* Imposta inizio pre spike */
if (PreSpikeStart != NULL)
*PreSpikeStart = IStart;
/* Imposta fine post spike */
if (PostSpikeEnd != NULL)
*PostSpikeEnd = IEnd;
/* Legge la risposta all'impulso */
switch (FType)
{
case PcmFloat64Bit:
for (I = IStart; I < IEnd; I++)
{
if (fread((void *) &RWD,sizeof(DRCFileDouble),1,IOF) != 1)
{
perror("\nError reading input file");
return False;
}
Dst[I] = (DLReal) RWD;
}
break;
case PcmFloat32Bit:
for (I = IStart; I < IEnd; I++)
{
if (fread((void *) &RWF,sizeof(DRCFileFloat),1,IOF) != 1)
{
perror("\nError reading input file");
return False;
}
Dst[I] = (DLReal) RWF;
}
break;
case PcmInt16Bit:
for (I = IStart; I < IEnd; I++)
{
if (fread((void *) &RWI,sizeof(DRCFileInt),1,IOF) != 1)
{
perror("\nError reading input file");
return False;
}
Dst[I] = (DLReal) RWI;
}
break;
}
/* Chiude il file */
fclose(IOF);
/* Operazione completata */
return True;
}
/* Scrive il segnale indicato su disco */
Boolean WriteSignal(const char * FName,const DRCFloat * Src,const int SSize,
const IFileType FType)
{
/* File gestione IO */
FILE * IOF;
int I;
DRCFileDouble RWD;
DRCFileFloat RWF;
DRCFileInt RWI;
/* Apre il file di output */
if ((IOF = fopen(FName,"wb")) == NULL)
{
perror("\nUnable to open output file");
return False;
}
/* Salva la risposta risultante */
switch (FType)
{
case PcmFloat64Bit:
for (I = 0; I < SSize; I++)
{
RWD = (DRCFileDouble) Src[I];
if (fwrite((void *) &RWD,sizeof(DRCFileDouble),1,IOF) != 1)
{
perror("\nError writing output file");
return False;
}
}
break;
case PcmFloat32Bit:
for (I = 0; I < SSize; I++)
{
RWF = (DRCFileFloat) Src[I];
if (fwrite((void *) &RWF,sizeof(DRCFileFloat),1,IOF) != 1)
{
perror("\nError writing output file");
return False;
}
}
break;
case PcmInt16Bit:
for (I = 0; I < SSize; I++)
{
RWI = (DRCFileInt) floor(0.5 + Src[I]);
if (fwrite((void *) &RWI,sizeof(DRCFileInt),1,IOF) != 1)
{
perror("\nError writing output file");
return False;
}
}
break;
}
/* Chiude il file */
fclose(IOF);
/* Operazione completata */
return True;
}
/* Sovrascrive il segnale indicato su disco */
Boolean OverwriteSignal(const char * FName,const DRCFloat * Src,const int SSize, const int Skip,
const IFileType FType)
{
/* File gestione IO */
FILE * IOF;
int I;
DRCFileDouble RWD;
DRCFileFloat RWF;
DRCFileInt RWI;
/* Apre il file di output */
IOF = fopen(FName,"r+b");
/* Salva la risposta risultante */
switch (FType)
{
case PcmFloat64Bit:
fseek(IOF,Skip * sizeof(DRCFileDouble), SEEK_SET);
for (I = 0; I < SSize; I++)
{
RWD = (DRCFileDouble) Src[I];
if (fwrite((void *) &RWD,sizeof(DRCFileDouble),1,IOF) != 1)
{
perror("\nError writing output file.");
return False;
}
}
break;
case PcmFloat32Bit:
fseek(IOF,Skip * sizeof(DRCFileFloat), SEEK_SET);
for (I = 0; I < SSize; I++)
{
RWF = (DRCFileFloat) Src[I];
if (fwrite((void *) &RWF,sizeof(DRCFileFloat),1,IOF) != 1)
{
perror("\nError writing output file.");
return False;
}
}
break;
case PcmInt16Bit:
fseek(IOF,Skip * sizeof(DRCFileInt), SEEK_SET);
for (I = 0; I < SSize; I++)
{
RWI = (DRCFileInt) floor(0.5 + Src[I]);
if (fwrite((void *) &RWI,sizeof(DRCFileInt),1,IOF) != 1)
{
perror("\nError writing output file.");
return False;
}
}
break;
}
/* Chiude il file */
fclose(IOF);
/* Operazione completata */
return True;
}
/* Calcola l'autocorrelazione del segnale S */
Boolean AutoCorrelation(DLReal * S, int N)
{
DLComplex * C;
int I;
if ((C = new DLComplex[N]) == NULL)
return False;
for (I = 0; I < N; I++)
C[I] = S[I];
Fft(C,N);
for (I = 0; I < N; I++)
/* C[I] = C[I] * std::conj(C[I]); */
C[I] = std::real(C[I]) * std::real(C[I]) + std::imag(C[I]) * std::imag(C[I]);
IFft(C,N);
for (I = 0; I < N; I++)
S[I] = std::real(C[I]) / N;
delete[] C;
return True;
}
/* Calcola la cross correlazione tra S1 e S2 */
/* XC deve avere lunghezza 2N - 1 */
Boolean CrossCorrelation(DLReal * S1, DLReal * S2, int N, DLReal * XC)
{
DLComplex * C1;
DLComplex * C2;
int I;
if ((C1 = new DLComplex[2 * N]) == NULL)
return False;
if ((C2 = new DLComplex[2 * N]) == NULL)
{
delete[] C1;
return False;
}
for (I = 0; I < N; I++)
{
C1[I] = S1[I];
C2[I] = S2[I];
}
for (I = N; I < 2 * N; I++)
{
C1[I] = 0;
C2[I] = 0;
}
Fft(C1,2 * N);
Fft(C2,2 * N);
for (I = 0; I < 2 * N; I++)
C1[I] *= std::conj<DLReal>(C2[I]);
delete[] C2;
IFft(C1,2 * N);
for (I = 0; I < 2 * N - 1; I++)
XC[I] = std::real(C1[I]) / N;
delete[] C1;
return True;
}
/* Calcola il ritardo di gruppo del segnale S */
Boolean GroupDelay(const DLReal * S, const int N, DLReal * GD)
{
DLComplex * HA;
DLComplex * DHA;
int I;
if ((HA = new DLComplex[N]) == NULL)
return False;
if ((DHA = new DLComplex[N]) == NULL)
{
delete[] HA;
return False;
}
for(I = 0;I < N;I++)
{
HA[I] = S[I];
DHA[I] = S[I] * I;
}
Fft(HA,N);
Fft(DHA,N);
for(I = 0;I < N;I++)
GD[I] = std::real(DHA[I] / HA[I]);
delete[] HA;
delete[] DHA;
return True;
}
/* I/O Delay computation, reliable only for simple impulse responses */
DLReal LinearDelay(DLReal * Hn,unsigned int N,unsigned int Np,
DLReal MZE)
{
unsigned int I;
DLComplex * H;
DLComplex * H1;
DLComplex Sum,i(0,1);
if (Np == 0)
for(Np = 2;Np < N;Np <<= 1);
Np = 2*Np;
if ((H = new DLComplex[Np]) == NULL)
return(-1);
if ((H1 = new DLComplex[Np]) == NULL)
{
delete[](H);
return(-1);
}
for(I = 0;I < N;I++)
H[I] = Hn[I];
for(I = N;I < Np;I++)
H[I] = 0;
if (Fft(H,Np) == False)
{
delete[](H);
delete[](H1);
return(-1);
}
for(I = 0;I < N;I++)
H1[I] = I*Hn[I];
for(I = N;I < Np;I++)
H1[I] = 0;
if (Fft(H1,Np) == False)
{
delete[](H);
delete[](H1);
return(-1);
}
for(I = 0;I < Np;I++)
if (std::abs<DLReal>(H[I]) <= MZE)
{
H[I] = 1;
H1[I] = 0;
}
Sum = 0;
for(I = 0;I < Np;I++)
Sum += (-i*H1[I])/H[I];
delete[](H);
delete[](H1);
return(std::real<DLReal>(-Sum/(i*(DLReal) Np)));
}
/* Conta il numero di righe in un file */
int FLineCount(const char * FName)
{
/* File gestione IO */
FILE * IOF;
/* Variabili ausiliarie */
int LC;
char InStr[256];
/* Apre il file di input */
if ((IOF = fopen(FName,"rt")) == NULL)
{
perror("\nUnable to open input file.");
return False;
}
/* Conta le righe */
LC = 0;
while (fgets(InStr,256,IOF) != NULL)
LC++;
/* Chiude il file di input */
fclose(IOF);
/* Ritorna il numero di righe */
return LC;
}
/* Legge i punti di generazione filtro FIR dal file indicato */
Boolean ReadPoints(char * CorrFile,const TFMagType MagType,
DLReal * FilterFreqs,DLReal * FilterM,DLReal * FilterP,const int NPoints,
int SampleRate)
{
/* File gestione IO */
FILE * IOF;
/* Variabili ausiliarie */
int I;
float Freq;
float Mag;
float Phase;
char InStr[256];
/* Apre il file di correzione */
if ((IOF = fopen(CorrFile,"rt")) == NULL)
{
perror("\nUnable to open correction file.");
return False;
}
/* Legge i valori */
for (I = 0; I < NPoints; I++)
{
if (fgets(InStr,256,IOF) == NULL)
{
perror("\nError reading correction file");
return False;
}
Phase = 0;
if (sscanf(InStr,"%f %f %f",&Freq,&Mag,&Phase) < 2)
{
printf("Not enough parameters on line %d.",I);
sputs("Error reading correction file.");
return False;
}
/* Verifica il tipo di ampiezza */
if (MagType == MAGdB)
/* Ricava l'ampiezza assoluta dai dB */
Mag = (DLReal) pow(10.0,Mag / 20.0);
/* Imposta i punti per il filtro */
FilterFreqs[I] = (DLReal) (2 * Freq) / SampleRate;
FilterM[I] = (DLReal) Mag;
FilterP[I] = (DLReal) ((Phase * M_PI) / 180);
}
FilterFreqs[NPoints - 1] = (DLReal) 1.0;
/* Chiude il file di input */
fclose(IOF);
/* Operazione completata */
return True;
}
/* Integra due funzioni di trsferimento definite per punti, usando
una interpolazione lineare, ritorna il numero di punti generati,
che non sono mai pi di NPoints1 + NPoints2 */
int LITFMerge(DLReal * FilterFreqs1,DLComplex * FilterPoints1,const int NPoints1,
DLReal * FilterFreqs2,DLComplex * FilterPoints2,const int NPoints2,
DLReal * FilterFreqsOut,DLComplex * FilterPointsOut)
{
/* Indice sull'array di output */
int OI;
/* Indice sugli array di ingresso */
int I1;
int I2;
/* Calcolo interpolazione */
DLReal DMag;
DLReal DArg;
DLReal DFreq;
/* Inizializza gli indici ciclo interpolazione */
OI = 0;
I1 = 0;
I2 = 0;
/* Ciclo interpolazione */
while (I1 < NPoints1 || I2 < NPoints2)
{
if (FilterFreqs1[I1] == FilterFreqs2[I2])
{
/* Calcola il punto di uscita */
FilterFreqsOut[OI] = FilterFreqs1[I1];
FilterPointsOut[OI] = FilterPoints1[I1] * FilterPoints2[I2];
/* Avanza gli indici elaborati */
I1++;
I2++;
}
else
if (FilterFreqs1[I1] > FilterFreqs2[I2])
{
/* Calcola la frequeunza del punto di uscita */
FilterFreqsOut[OI] = FilterFreqs2[I2];
/* Calcola le variazioni per l'interpolazione */
DMag = std::abs(FilterPoints1[I1]) -
std::abs(FilterPoints1[I1 - 1]);
DArg = std::arg(FilterPoints1[I1]) -
std::arg(FilterPoints1[I1 - 1]);
DFreq = FilterFreqs1[I1] -
FilterFreqs1[I1 - 1];
/* Calcola il punto di uscita */
FilterPointsOut[OI] = FilterPoints2[I2] *
std::polar(std::abs(FilterPoints1[I1 - 1]) +
(FilterFreqsOut[OI] - FilterFreqs1[I1 - 1]) * DMag / DFreq,
std::arg(FilterPoints1[I1 - 1]) +
(FilterFreqsOut[OI] - FilterFreqs1[I1 - 1]) * DArg / DFreq);
/* Avanza l'indice elaborato */
I2++;
}
else
{
/* Calcola la frequeunza del punto di uscita */
FilterFreqsOut[OI] = FilterFreqs1[I1];
/* Calcola le variazioni per l'interpolazione */
DMag = std::abs(FilterPoints2[I2]) -
std::abs(FilterPoints2[I2 - 1]);
DArg = std::arg(FilterPoints2[I2]) -
std::arg(FilterPoints2[I2 - 1]);
DFreq = FilterFreqs2[I2] -
FilterFreqs2[I2 - 1];
/* Calcola il punto di uscita */
FilterPointsOut[OI] = FilterPoints1[I1] *
std::polar(std::abs(FilterPoints2[I2 - 1]) +
(FilterFreqsOut[OI] - FilterFreqs2[I2 - 1]) * DMag / DFreq,
std::arg(FilterPoints2[I2 - 1]) +
(FilterFreqsOut[OI] - FilterFreqs2[I2 - 1]) * DArg / DFreq);
/* Avanza l'indice elaborato */
I1++;
}
/* Avanza l'indice di uscita */
OI++;
}
/* Ritorna il numero punti generati */
return OI;
}
/* Trova il valore massimo all'interno di un file. Versione float 64 bit. */
static int FindMaxPcmFloat64Bit(const char * FName)
{
DRCFileDouble RWD;
int MaxPos;
int Pos;
DRCFileDouble PcmMax;
/* File gestione IO */
FILE * IOF;
/* Apre il file di input */
if ((IOF = fopen(FName,"rb")) == NULL)
{
perror("\nUnable to open input file.");
return -1;
}
/* Ciclo ricerca massimo */
Pos = 0;
MaxPos = 0;
PcmMax = 0;
while(feof(IOF) == 0)
{
if (fread((void *) &RWD,sizeof(DRCFileDouble),1,IOF) != 1)
{
if (feof(IOF) == 0)
{
perror("\nError reading input file.");
return -1;
}
}
if (((DRCFileFloat) fabs(RWD)) > PcmMax)
{
PcmMax = (DRCFileFloat) fabs(RWD);
MaxPos = Pos;
}
Pos++;
}
/* Chiude il file di input */
fclose(IOF);
/* Operazione completata */
return MaxPos;
}
/* Trova il valore massimo all'interno di un file. Versione float 32 bit. */
static int FindMaxPcmFloat32Bit(const char * FName)
{
DRCFileFloat RWF;
int MaxPos;
int Pos;
DRCFileFloat PcmMax;
/* File gestione IO */
FILE * IOF;
/* Apre il file di input */
if ((IOF = fopen(FName,"rb")) == NULL)
{
perror("\nUnable to open input file.");
return -1;
}
/* Ciclo ricerca massimo */
Pos = 0;
MaxPos = 0;
PcmMax = 0;
while(feof(IOF) == 0)
{
if (fread((void *) &RWF,sizeof(DRCFileFloat),1,IOF) != 1)
{
if (feof(IOF) == 0)
{
perror("\nError reading input file.");
return -1;
}
}
if (((DRCFileFloat) fabs(RWF)) > PcmMax)
{
PcmMax = (DRCFileFloat) fabs(RWF);
MaxPos = Pos;
}
Pos++;
}
/* Chiude il file di input */
fclose(IOF);
/* Operazione completata */
return MaxPos;
}
/* Trova il valore massimo all'interno di un file. Versione int 16 Bit. */
static int FindMaxPcmInt16Bit(const char * FName)
{
DRCFileInt RWI;
int MaxPos;
int Pos;
DRCFileInt PcmMax;
/* File gestione IO */
FILE * IOF;
/* Apre il file di input */
if ((IOF = fopen(FName,"rb")) == NULL)
{
perror("\nUnable to open input file.");
return -1;
}
/* Ciclo ricerca massimo */
Pos = 0;
MaxPos = 0;
PcmMax = 0;
while(feof(IOF) == 0)
{
if (fread((void *) &RWI,sizeof(DRCFileInt),1,IOF) != 1)
{
if (feof(IOF) == 0)
{
perror("\nError reading input file.");
return -1;
}
}
if (((DRCFileInt) abs(RWI)) > PcmMax)
{
PcmMax = (DRCFileInt) abs(RWI);
MaxPos = Pos;
}
Pos++;
}
/* Chiude il file di input */
fclose(IOF);
/* Operazione completata */
return MaxPos;
}
/* Trova il valore massimo all'interno di un file. */
int FindMaxPcm(const char * FName,const IFileType FType)
{
/* Controlla il tipo file */
switch (FType)
{
case PcmFloat64Bit:
return FindMaxPcmFloat64Bit(FName);
case PcmFloat32Bit:
return FindMaxPcmFloat32Bit(FName);
case PcmInt16Bit:
return FindMaxPcmInt16Bit(FName);
}
/* Tipo file errato */
return -1;
}
|