-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsound.h
36 lines (27 loc) · 1.38 KB
/
sound.h
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
/*
1. The sound system is kickstarted by calling sound_thread_start() with the
device id (as a string).
2. The sound system is run in separate thread and it keeps calling sound_process()
WARNING: sound_process() is being called from a different thread. It should
return quickly before the next set of audio data is due.
3. The left channel is used for rx and the right channel is used for tx.
The left channel takes its input (between 0 and 48 KHz( from the rx,
demodulates it and writes out to the speaker/audio output.
4. The right channel gets audio data from mic, modulates it as a signal between
0 and 48 KHz and sends it out to right channel output.
5. A number of settings for the sound card like gain, etc can be set by calling
sound_mixer(). search for this function to know how to work this.
*/
#define UNUSED_PARAMETER 0
#define RX_VOLUME_CONTROL 1
#define TX_GAIN_CONTROL 2
// int sound_thread_start(char *device); // Commented out N3SB 04-Feb-2024
int sound_thread_start(char *if_input_device, char *sound_output_device); // N3SB Hack to support two device parameters
void sound_process(
int32_t *input_rx, int32_t *input_mic,
int32_t *output_speaker, int32_t *output_tx,
int n_samples);
void sound_thread_stop();
void sound_volume(char *card_name, char *element, int volume);
void sound_mixer(char *card_name, char *element, int channel, int make_on);
void sound_input(int loop);