Use the getTokenParams() function, passing your token ID.
Note the 'p1', 'p2', 'p3' parameter values 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/0x7a8b6f7089aeabb0f55d0b5af8b996734afaee764d8aa25fe347d47394158474 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.
void init_token_params() { // insert token ID... token_params.noumenon_token_id = 0; // ...and the parameters returned from smart contract function getTokenParam(tokenID,x); // token ID of the most recently generated Chronophotograph // insert return value of getTokenParam(tokenID,1) token_params.chronophotograph_token_id = 0; // blocknumber when the Chronophotograph was generated // insert return value of getTokenParam(tokenID,2) token_params.blocknumber = 0; // epoch of the Chronophotograph // insert return value of getTokenParam(tokenID,3) token_params.epoch = 0; }Replace your token ID, and replace the indicated values with the 'p1','p2','p3' values previously read through getTokenParams(). For example:
void init_token_params() { // insert token ID... token_params.noumenon_token_id = 17; // ...and the parameters returned from smart contract function getTokenParam(tokenID,x); // token ID of the most recently generated Chronophotograph // insert return value of getTokenParam(tokenID,1) token_params.chronophotograph_token_id = 261; // blocknumber when the Chronophotograph was generated // insert return value of getTokenParam(tokenID,2) token_params.blocknumber = 19867740; // epoch of the Chronophotograph // insert return value of getTokenParam(tokenID,3) token_params.epoch = 19; }
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.
Examples:
Encode images and audio into an MP4 video file: $ ffmpeg -framerate 24 -i frames/frame%04d.bmp -i output.wav -crf 20 -c:v libx264 -c:a aac -b:a 192k -pix_fmt yuv420p -shortest -y audiovisual.mp4