Lumiera  0.pre.03
»edit your freedom«
main.c
Go to the documentation of this file.
1 /*
2  OutputProbe - tool to investigate external output connections
3 
4  Copyright (C)
5  2011, Odin Omdal Hørthe <odin.omdal@gmail.com>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 * *****************************************************************/
13 
14 
23 #include "alsa.h"
24 
25 #include <unistd.h>
26 #include <stdint.h>
27 #include <stdio.h>
28 
29 
30 #define SAMPLE_RATE 44100
31 
32 int16_t quiet[SAMPLE_RATE],
33  noisy[SAMPLE_RATE];
34 
35 
36 int
37 main()
38  {
39 
40  for (int i = 0; i < SAMPLE_RATE; i++)
41  {
42  quiet[i] = 0;
43  noisy[i] = i % 30000;
44  }
45  audio_start (44100, 2);
46 
47  for (int i = 0; i < 10; i++)
48  {
49  audio_write (noisy, SAMPLE_RATE);
50  printf ("=================================\n");
51  audio_write (quiet, SAMPLE_RATE);
52  printf ("\n");
53  }
54 
55  audio_stop ();
56 
57  return 0;
58  }
int main(int argc, const char *argv[])
run all tests or any single test specified in the first command line argument.
Definition: testrunner.cpp:37
Interfacing to ALSA sound output.