sox mo.wav -e unsigned -b 8 -c 1 -r 48k mo.raw
bytes=`stat -f %z mo.raw`
width=`echo sqrt\($bytes\) | bc`
square_bytes=`echo $width \* $width | bc`
dd if=mo.raw of=mo_square.raw bs=$square_bytes count=1
gm convert -depth 8 -size ${width}x${width} gray:mo_square.raw -quality 50 mo_square.jpg
gm convert mo_square.jpg gray:mo_square_jpg.raw
sox -e unsigned -b 8 -c 1 -r 48k -t raw mo_square_jpg.raw mo_jpg.wav
Those methods come from the world of non-realtime CG rendering though - running truly accurate simulations with the aberrations changing across the field on phone hardware at any decent speed is pretty challenging...