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) Lumiera.org
5  2011, Odin Omdal Hørthe <odin.omdal@gmail.com>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 * *****************************************************/
22 
23 
32 #include "alsa.h"
33 
34 #include <unistd.h>
35 #include <stdint.h>
36 #include <stdio.h>
37 
38 
39 #define SAMPLE_RATE 44100
40 
41 int16_t quiet[SAMPLE_RATE],
42  noisy[SAMPLE_RATE];
43 
44 
45 int
46 main()
47  {
48 
49  for (int i = 0; i < SAMPLE_RATE; i++)
50  {
51  quiet[i] = 0;
52  noisy[i] = i % 30000;
53  }
54  audio_start (44100, 2);
55 
56  for (int i = 0; i < 10; i++)
57  {
58  audio_write (noisy, SAMPLE_RATE);
59  printf ("=================================\n");
60  audio_write (quiet, SAMPLE_RATE);
61  printf ("\n");
62  }
63 
64  audio_stop ();
65 
66  return 0;
67  }
int main(int argc, const char *argv[])
run all tests or any single test specified in the first command line argument.
Definition: testrunner.cpp:47
Interfacing to ALSA sound output.