A small PyQt6 desktop app that generates a mono sine-wave WAV file.
Set sample rate, duration, frequency, volume, choose an output folder, and export a .wav.
wav_gen.py— main application (loads the UI, handles events, generates the WAV output)interface_gen.py— PyQt6 UI layout (generated UI class used bywav_gen.py)
- Folder picker for output directory
- Generates mono WAV (16-bit PCM)
- Adjustable parameters:
- Sample rate (e.g., 44100)
- Duration (seconds)
- Frequency (Hz)
- Volume (float)
- Output filename
- Python 3.x
- PyQt6
Install:
pip install PyQt6python wav_gen.py- Run the app.
- Click Select Folder and choose where to save the file.
- Enter:
- sample rate
- duration (seconds)
- frequency (Hz)
- volume
- output filename
- Click Generate to create the
.wav.
The app saves the generated file to:
<selected_folder>/<filename>.wav
The WAV generation logic in this project is adapted from the MIT-licensed script:
- Alessandro Cudazzo — “Generate a sine wave and save it in a wav file” (
sine_wave.py)
https://gist.github.com/alessandrocuda/9df6043b79e68e3ddc1c262eddcfa015
If you further modify the WAV generation code, keep the attribution in the source file(s) that include adapted portions.
- Output is mono only (this GUI version focuses on mono export).
interface_gen.pyis generated UI code; typically you only edit logic inwav_gen.py.