Create audio tones directly from the command line. FFmpeg is not just a powerful tool for converting or editing audio and video files; is a powerful multimedia framework that can generate audio tones without the need for external files. This capability is particularly useful for creating test signals, sound effects, or even chiptune music directly from the terminal. For instructions and examples see below. The source code is hosted on GitHub. Before using this tool, read the LEGAL NOTES/DISCLAIMER.
Insert all parameters
- Wave Type: Sine
- Frequency: 440 Hz
- Duration: 5 seconds
- Amplitude: 0.2
- Output file name: output.wav
Click 'Generate'.
The tool informs you in red text if some parameters are incorrect or missing.
If all parameters are correct, you will obtain the FFmpeg code in the dedicated textarea:
ffmpeg -f lavfi -i "sine=frequency=440:duration=5" output.wav
This command uses FFmpeg's lavfi (Libavfilter) input device to generate a sine wave. The frequency parameter sets the tone's pitch, and duration specifies how long the tone lasts. The output file is saved as output.wav.
Copy the command with the appropriate button, open a terminal or command prompt in your desired folder, paste the command, and execute it to create the file.
To generate the tone in MP3 format instead, simply change the output file extension:
ffmpeg -f lavfi -i "sine=frequency=440:duration=5" output.mp3
Notes on Output Formats:
- .wav – Uncompressed audio format, widely supported and suitable for high-quality audio.
- .mp3 – Compressed audio format, ideal for smaller file sizes and streaming.
- .flac – Lossless compressed audio format, preserving original quality with reduced file size.
To specify a different output format, simply change the file extension in the output file name. If you encounter any issues, need further assistance, or have specific requirements for your audio generation tasks, feel free to ask! Use the comments below or the contact form.
Comments
Post a Comment