[Solved] How to generate a silence audio file? ||How to write in silence audio?
-
Hello everyone!
As the title said, how can I generate a silence audio file?
Like, a sound file, but it's muted, and have difference duration like 1 minutes, 10 minutes, etc..
Or, how can I make QFile to write in silence audio? Is there a way?
For example, I have 1 sound file called file1.ogg, the media's duration is 10 seconds.
So, how can I write to this file1.ogg a null sound 1 minutes long, so that after playing it's original 10 secs, the file will silence in 1 seconds then stop?
I'm thinking of record a 1 second mute sound, then use a loop to make a file write it till the duration I need.
But I think there might be another straight-forward way to do this ?
Thanks for any reply!
-
You have a few options. Here are some examples; #1 is easiest, #3 is hardest:
Download a 3rd-party program that does it: http://www.softpedia.com/get/Multimedia/Audio/Other-AUDIO-Tools/Silence.shtml (the website broke the link... copy+paste the whole link into your browser) You can also Google for others
Use Sound Recorder (assuming you run Windows) to record silence: http://www.instructables.com/id/How-to-stop-reaccurring-annoying-phone-calls-bill/step1/creating-the-silent-sound-file/
If you know audio processing, you can pass an array of 0's into wavwrite() in GNU Octave: http://www.gnu.org/software/octave/
-
Does that mean I can't archive this with Qt's Classes?
-
No, unless you link a 3rd-party library to your project, like libsndfile (http://www.mega-nerd.com/libsndfile/ ), and write extra code for it. This is even harder than Option #3 above (using GNU Octave)
-
Thanks JKSH, the information you provided was really helpful :)
Cheer!