freqGen
Generate different types of sound waves through the default speaker of Linux system using Advanced Linux Sound Architecture (ALSA).
- Generate sound waves in different types ( Sine , Square, Triangualr, Sawtooth).
- Adjust Frequency, Phase , Volume, and the Wave type of each channel independently.
gcc -o freqGen freqGen.c -lm -lpthread -lasound
./freqGen [options]
-r sample rate (Hz)
-l buffer time uSec (latency)
-f channel 1 freqency (Left)
-F channel 2 frequency (Right)
-v channel 1 volume (Left)
-V channel 2 volume (Right)
-h help message
To change the wave type for channels press :
Wave Type | Left chn | Right chn |
---|---|---|
Sine | 1 | 0 |
Square | 2 | 9 |
Triangular | 3 | 8 |
Sawtooth | 4 | 7 |
There are two methods to change the frequency :
- Press 'f' and enter the new frequency for channel 1 (Left).
- Press 'F' and enter the new frequency for channel 2 (Right).
Freqency | Left chn | Right chn | Both chns |
---|---|---|---|
+ | U | O | I |
- | J | L | K |
There are two methods to change the wave phase :
- Press 'p' and enter the new wave phase for channel 1 (Left).
- Press 'P' and enter the new wave phase for channel 2 (Right).
Wave Phase | Left chn | Right chn |
---|---|---|
+ | G | H |
- | B | N |
There are two methods to change the volume :
- Press 'v' and enter the new volume for channel 1 (Left).
- Press 'V' and enter the new volume for channel 2 (Right).
Volume | Left chn | Right chn | Both chns |
---|---|---|---|
+ | A | F | S |
- | Z | C | X |
Press 'q' to exit from the program.