diff --git a/command-center/command-center.lua b/command-center/command-center.lua new file mode 100644 index 0000000..b54aad8 --- /dev/null +++ b/command-center/command-center.lua @@ -0,0 +1,5 @@ + +local monitorMainRight = peripheral.wrap("monitor_16") +local monitorMainLeft = peripheral.wrap("monitor_17") +local monitorTopRight = peripheral.wrap("monitor_19") +local monitorTopLeft = peripheral.wrap("monitor_18") \ No newline at end of file diff --git a/pcmToLua.d b/pcmToLua.d new file mode 100755 index 0000000..628af94 --- /dev/null +++ b/pcmToLua.d @@ -0,0 +1,30 @@ +#!/usr/bin/env rdmd +/** + * Converts a signed 8-bit PCM audio file into a Lua table list. + */ +module pcm_to_lua; + +import std.stdio; +import std.file; + +int main(string[] args) { + if (args.length < 2) { + stderr.writeln("Missing required file."); + return 1; + } + string audioFilename = args[1]; + if (!exists(audioFilename)) { + stderr.writefln!"File %s doesn't exist."(audioFilename); + return 1; + } + + byte[] contents = cast(byte[]) std.file.read(audioFilename); + stdout.writeln("local audio = {"); + foreach (byte sample; contents) { + stdout.writefln!" %d,"(sample); + } + stdout.writeln("}"); + + return 0; +} +