This C++ program generates various types of sound waves and writes them to a WAV file. It supports wave types like square, sawtooth, triangle, sine, white noise, brown noise, and chirp. The program is also capable of creating WAV files shorter than 1 second.
Additional features include the application of low-pass filtering, amplitude modulation, and amplitude envelopes.
- Clone the repository:
git clone [https://github.com/roger-ui/WaveWriter-Audio-Waveform-Generator-.git]
- Navigate to the cloned directory:
cd WaveFileGenerator
- Compile the source code:
g++ -o WaveFileGenerator WriteWaveFile.cpp
To use the WaveFileGenerator, run the executable from the command line with the desired parameters.
--type
: Type of wave (square, sawtooth, triangle, sine, whitenoise, brownnoise, chirp)--freq
: Frequency of the wave (for tonal waves)--duration
: Duration of the audio in seconds--output
: Output file name--use-filter
: Apply a low pass filter--cutoff
: Cutoff frequency for the low pass filter--amplitude
: Amplitude factor of the wave--start-freq
: Start frequency for chirp waves--end-freq
: End frequency for chirp waves--apply-envelope
: Apply an amplitude envelope to the wave
- Generate a 5-second sine wave at 440 Hz:
./WaveFileGenerator.exe --type sine --freq 440 --duration 5 --output my_sine_wave.wav
- Generate a 10-second chirp from 200 Hz to 2000 Hz:
./WaveFileGenerator.exe --type chirp --start-freq 200 --end-freq 2000 --duration 10 --output chirp_wave.wav
Wave Writer Audio Waveform Generator is licensed under the MIT License.
See LICENCE in this repository for details.