This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
AyScorch's profile picture

[N00B] Download audio files onto computer for Computronics

Started by AyScorch, 11 June 2018 - 07:32 PM
AyScorch #1
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 :)/>
Luca_S #2
Posted 11 June 2018 - 10:12 PM
Check 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()
Edited on 11 June 2018 - 08:13 PM
AyScorch #3
Posted 11 June 2018 - 10:33 PM
Check 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()
i am on 1.12.2, it does not work due to a index null error with F
KingofGamesYami #4
Posted 12 June 2018 - 12:23 AM
Have you spelled fs correctly?
Bomb Bloke #5
Posted 12 June 2018 - 12:33 AM
Assuming you have, make sure the file name you're specifying actually exists on your computer's drive. "yourfile.dfpwm" won't work unless that's the actual name you used when re-encoding your audio with LionRay!

If you're still having trouble, post the exact error message you receive. Approximations aren't helpful.