Algorithm-Arena / weekly-challenge-23-unconventional-randomness

0 stars 1 forks source link

Submission - Audio random #3

Open seanyang0813 opened 3 months ago

seanyang0813 commented 3 months ago

Demo video

Screencast from 06-22-2024 08:08:08 PM.webm

Method

  1. Record audio
  2. Convert audio blob into array buffer that is int8
  3. Start from the middle of the buffer in case encoding's start contains more metadata to make it more random grab the value at index / 255 for a value between 0 and 1 and then change index by adding the value with the index and adding nth iteration % buffer size in case we create some loop
  4. repeat step 4 for 100 times
  5. display the values in a textarea Test https://cieciura.net/mp/kalkulatory/randomness.htm thanks to @alshakero for the test method

    Try it out

    https://audiorand.vercel.app/

    source code

    https://github.com/seanyang0813/audiorand