ElijahCrafter

MicTest2

Dec 2nd, 2025
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | Source Code | 0 0
  1. -- Setup
  2. local mic = peripheral.find("microphone")
  3. local speaker = peripheral.find("speaker")
  4.  
  5. -- Record
  6. mic.startListening()
  7. mic.startRecording("test")
  8. sleep(5)  -- Record for 5 seconds
  9. mic.stopRecording()
  10.  
  11. -- Play back - just use the recording name!
  12. speaker.playRecording("test")
  13.  
  14. -- Or specify a larger search range if microphone is far away
  15. speaker.playRecording("test", 32)
Advertisement
Add Comment
Please, Sign In to add comment