Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Load the dfpwm library and find the speaker
- local dfpwm = require("cc.audio.dfpwm")
- local speaker = peripheral.find("speaker")
- -- Function to play sound
- local function playSound(filename)
- local decoder = dfpwm.make_decoder()
- local file = fs.open(filename, "rb")
- while true do
- local chunk = file.read(16 * 1024)
- if not chunk then break end
- local buffer = decoder(chunk)
- while not speaker.playAudio(buffer) do
- os.pullEvent("speaker_audio_empty")
- end
- end
- file.close()
- end
- -- Function to display the Windows 11 boot screen on the computer terminal
- local function displayBootScreen()
- term.clear()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.black)
- print("Starting Windows 11...")
- print()
- print("Please wait while we prepare your system...")
- end
- -- Main function
- local function main()
- displayBootScreen()
- sleep(2) -- Show the boot screen for 2 seconds
- playSound("data/sound.dfpwm")
- end
- -- Run the main function
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement