Lumiera
0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
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
}
audio_start
void audio_start(unsigned int rate, unsigned int channel_count)
Definition
alsa.c:155
audio_stop
void audio_stop()
Definition
alsa.c:163
audio_write
size_t audio_write(const void *data, size_t amount)
Definition
alsa.c:122
alsa.h
Interfacing to ALSA sound output.
SAMPLE_RATE
#define SAMPLE_RATE
Definition
main.c:30
noisy
int16_t noisy[SAMPLE_RATE]
Definition
main.c:33
quiet
int16_t quiet[SAMPLE_RATE]
Definition
main.c:32
main
int main()
Definition
main.c:37
tool
main.c
Generated on Fri Nov 7 2025 for Lumiera by
1.9.8