Audio of Babel

! WARNING: This application generates random audio. Some sounds may be loud or jarring. Please use caution and consider lowering your volume before playing.

Sample Rate: Hz | Duration: seconds

Current Seed:

How It Works

Audio of Babel generates unique audio samples based on a seed value. Here's a detailed explanation of the process:

1. Seed Generation

- If the user doesn't provide a seed, a random Unicode string is generated.

- The seed can contain any Unicode character, allowing for a vast number of possible inputs.

2. Pseudo-Random Number Generation

- The seed is used to initialize a seeded random number generator (RNG) using the SeedRandom library.

- This ensures that the same seed always produces the same audio output.

3. Duration Determination

- The seed is used to determine the duration of the audio clip.

- Duration ranges from 0.001 second (1 millisecond) to 30 seconds, calculated as:

duration = 0.001 + seededRandom() * 29.999

4. Audio Buffer Creation

- An AudioContext is created to handle audio processing.

- The number of samples (frameCount) is calculated based on the sample rate and duration.

- An AudioBuffer is created with these specifications.

5. Sample Generation

- For each sample in the buffer:

sample = seededRandom() * 2 - 1

- This generates values between -1 and 1, creating white noise.

6. Offline Rendering

- An OfflineAudioContext is used to render the audio without real-time playback.

- This allows for faster processing and generation of the complete audio file.

7. WAV File Creation

- The rendered audio buffer is converted to a WAV file format.

- This involves creating a proper WAV header and encoding the audio data.

8. Playback and Visualization

- The WAV file is set as the source for the audio player.

- WaveSurfer.js is used to create a visual representation of the audio waveform.

9. Information Display

- The current seed, sample rate, and duration are displayed to the user.

Key Features

- Deterministic: The same seed always produces the same audio.

- Unicode Support: Seeds can include any Unicode character, vastly expanding possible inputs.

- Variable Duration: Each seed produces a unique duration between 0.001 and 30 seconds.

- White Noise Generation: The audio consists of random samples, creating white noise.

- Client-Side Processing: All audio generation happens in the user's browser, ensuring privacy and reducing server load.