In answer to the question "How-to make a silent mp3 or wav-file" on ubuntuforums.org FakeOutdoorsman provided the following recipe:
Another method by using FFmpeg. 60 seconds of silent audio in WAV:
ffmpeg -ar 48000 -t 60 -f s16le -acodec pcm_s16le -ac 2 -i /dev/zero -acodec copy output.wav
60 seconds of silent audio in MP3:
ffmpeg -ar 48000 -t 60 -f s16le -acodec pcm_s16le -ac 2 -i /dev/zero -acodec libmp3lame -aq 4 output.mp3
How could I do something similar to create a silent .ogg audio file?
For a web app, I want to create a very short file for testing whether the browser will preload an audio file, or whether it will wait until the file is actually played before starting to stream it.
libvorbis
instead ofvorbis
. The output for 30ms is 3,694 bytes. I can get a 30ms MP3 file for 333 bytes. At wittnl's page on GitHub I found a dataURL for a silent ogg that is less than 300 bytes, including base64 encoding... – Stickle