Posted 11 June 2018 - 09:33 PM
Im trying to download a .wav file onto a computer to encode it onto a Computronic Cassete.
i mean, how to do it :)/>
i mean, how to do it :)/>
local drive = peripheral.wrap("left") --Replace left with the side of the tape drive
local f = fs.open("yourfile.dfpwm", "rb") --Replace yourfile with the filename
local byte
repeat
byte = f.read()
if byte then drive.write(byte) end
until not byte
f.close()
i am on 1.12.2, it does not work due to a index null error with FCheck out this wiki link for a program to convert your wav into an appropriate format: https://wiki.vexatos...mputronics:tape
(The download link has changed but the wiki apparently isn't updated. Use the download link you can find in the Readme in the github repo: https://github.com/gamax92/LionRay )
To write the resulting file to a tape use this code(Untested):local drive = peripheral.wrap("left") --Replace left with the side of the tape drive local f = fs.open("yourfile.dfpwm", "rb") --Replace yourfile with the filename local byte repeat byte = f.read() if byte then drive.write(byte) end until not byte f.close()