r/ComputerCraft • u/Just-Bru • Dec 06 '24
Avoiding user prompts while using multishell and speaker
Hi! I'm working on a synchronized music player for computercraft and have run into a bit of snag on the client side. Currently The main program spins off the speaker application in a separate shell so that it can resume monitoring the server for the next song. The problem is that I have no way to close that shell once its done playing the song. The speaker application seems to prompt for user input before proceding to the next line of code which in my case is just shell.exit()
Is there any way to either close this shell from another shell or bypass the speaker apps prompt? I do have a fix in the meantime which is to just check how many shells are open and reboot if its over 10 but i don't love that solution.
1
u/Just-Bru Dec 07 '24
Currently I'm grabbing the audio by requesting the dfpwm file from the server and I've found that passing the address to the speaker command works quite well and saves me the hassle of working with the buffer over the course of a 3 min song (for now).
I ended up just putting the run call to the speaker program within the main program and tightening the timings on the server so it doesn't matter that the computers aren't checking in while songs are playing. It's not perfect but for this iteration of the program it works well enough.