Digitális hangminták
Gaga
Típusdefiníciók | Függvények
amplify.c fájlreferencia

Stereo PCM to PCM amplifier plugin. Részletek...

#include <stdio.h>
#include "binary_streams.h"

Ugrás a fájl forráskódjához.

Típusdefiníciók

typedef float sample_t
 type of a single sample
 

Függvények

int main (int argc, char **argv)
 the plugin main function Részletek...
 

Részletes leírás

Stereo PCM to PCM amplifier plugin.

Szerző
P. Fiala
Dátum
2020-12-07

Definíció a(z) amplify.c fájlban.

Függvények dokumentációja

◆ main()

int main ( int  argc,
char **  argv 
)

the plugin main function

Paraméterek
argcnumber of command line arguments
argvargument vector
Visszatérési érték
int zero for success

Definíció a(z) amplify.c fájl 19. sorában.

20 {
21  // read command line argument (gain)
22  double gain = 1.0;
23  if (argc > 1)
24  sscanf(argv[1], "%lf", &gain);
25 
26  // reopen streams as binary
28 
29  // read samples while possible
30  sample_t samples[2];
31  while (fread(samples, sizeof(sample_t), 2, stdin) == 2)
32  {
33  // apply amplification
34  samples[0] *= gain;
35  samples[1] *= gain;
36 
37  // write samples
38  fwrite(samples, sizeof(sample_t), 2, stdout);
39  }
40  return 0;
41 }

Hivatkozások binary_streams.

sample_t
float sample_t
type of a single sample
Definition: amplify.c:11
binary_streams
#define binary_streams()
reopen standard streams as binary
Definition: binary_streams.h:17