Use the getTokenParams() function, passing your token ID.
Note the 'seed' value which is the random hash that you will later need. 'codeLocation0' is the address of the transaction that contains the C source code. Visit that transaction address on etherscan, in this example it's https://etherscan.io/tx/0xf784123a3043f98fbdbb7efe168f61bf1d1f0eaea8fb46b5290abb3e759beae8 Press 'Click to see More' and view the 'Input Data' field as UTF-8.
Copy and paste the C source code into a file on your computer named main.c.
char *seed="0x2c68ca657f166e1e7a5db2266ee1edca9daf2da5ecc689c39c1d8cfe0b9aad2e";Replace that value with the 'seed' value previously read through getTokenParams().
Code conforms to the ISO c99 standard. Only library dependency is C math library. Pass '-lm' to gcc. Assumes architecture is little endian (all Intel processors)First, create directory to store output images:
$ mkdir 'frames'Next, compile and run. Optionally pass '-Ofast' flag to enable optimization (faster rendering).
$ gcc -Ofast main.c -lm && ./a.out
This will produce:
a. Numbered image files in BMP file format stored in 'frames' directory. 24 FPS(frames per second)
b. Audio file named 'output.wav' in WAV format, stereo, 44.1khz, 16bit depth
This is the 'raw' information representing digital audio signals and image pixel intensities.
This raw information can be encoded perceptually using whatever tools exist at the time of reconstruction. At present, for example, opensource tools such as imagemagick and ffmpeg can be used to encode images,video and audio in different format for popular distributions. Linux platform is recommended, ffmpeg is available from default package manager. On Mac platform, use Homebrew to install ffmpeg.
1. Audio can be encoded to MP3. $ ffmpeg -i output.wav -b 192k output.mp3 2. Images can be assembled into an animation and encoded to MP4, for example: $ ffmpeg -framerate 24 -i frames/frame%04d.bmp -crf 20 video.mp4 3. audio can be encoded with video: $ ffmpeg -i output.wav -i video.mp4 -c:v libx264 -c:a aac -b:a 192k -pix_fmt yuv420p -shortest audiovisual.mp4 4. Screenshots of particular frames(in this example, frame 60), using imagemagick: $ convert frames/frame0060.bmp -scale 720x720 image.png