15
The challenge is: generate an audio file made of white noise.
Requirements and instructions:
- Your program must generate an audio file containing only white noise, meaning its intensity is the same for all (reasonable) frequencies and nonzero [see an example plot];
- One must be able to play the audio file on the latest version of VLC [at the time of writing your answer];
- The program doesn't need cryptographically-strong randomness,
rand
functions or reading from/dev/rand
is okay; - The program must be able to generate at least 1 hour of audio, at least in theory (meaning system limitations like maximum filesize don't apply);
- Your score is the number of bytes in your source code, plus all bonuses that apply;
- Using any third-party, external library is okay;
- The program must work without access to the Internet.
Bonuses are:
- -15%: Allow to specify the format of the audio file (at least two choices; the number of possible choices doesn't change the score);
- -10%: Allow to specify the duration of the audio file;
- -5%: Allow to specify the bitrate of the audio file.
The settings can be stored in variables, files, or given as command line parameters, your choice. Percentages are calculated from the original number of bytes, before any bonus is applied.
What about WebAudioAPI? I coded js program, that plays white noise – Евгений Новиков – 2017-08-02T09:53:25.790
The problem spec seems to be describing a code colfing challenge, but the tags say otherwise. – undergroundmonorail – 2014-03-05T16:02:42.137
Whoops! I'll fix that. – Giulio Muscarello – 2014-03-05T16:03:36.037
Perhaps the challenge should be revised to only allow "existing third party libraries" instead of "any library". – jpmc26 – 2014-03-06T01:02:28.153
Are you going to be a stickler on the noise being white? If you really want to verify: its autocorrelogram should have a clear spike around zero, and almost nothing at any other delay. If you aren't going to be a stickler, I say that it is pointless to specify that it be white noise. Just say noise. – Tim Seguine – 2014-03-06T15:13:03.503