Main Menu

Multiple Wireless Speakers

Started by LostVint, Mar 07, 2021, 12:49 PM

Previous topic - Next topic

LostVint

I'm trying to make it so I can have multiple wireless speakers throughout my base, and they would all play the same sound at the same time from my jukebox program. The problem I'm running into is that only the speaker closest to the computer sending the rednet message is playing any sound. How would I make multiple speakers all play at the same time?

Lupus590

How are you getting a wireless speaker setup? Peripherals cannot be wireless without using workarounds.

Once you have all the speakers connected to the jukebox computer (either via a workaround or wired) you should just need to send the same signal to all the speakers whenever you send it to one. You could do this via a fake peripheral, which is basically what the workaround for wireless peripherals does. This fake peripheral would replicate the action acted onto it on each of the real peripherals that it's wrapped.

LostVint

Quote from: Lupus590 on Mar 07, 2021, 01:51 PMHow are you getting a wireless speaker setup? Peripherals cannot be wireless without using workarounds.

Once you have all the speakers connected to the jukebox computer (either via a workaround or wired) you should just need to send the same signal to all the speakers whenever you send it to one. You could do this via a fake peripheral, which is basically what the workaround for wireless peripherals does. This fake peripheral would replicate the action acted onto it on each of the real peripherals that it's wrapped.

Right now I have it set up so that there is a different computer connected to each speaker that receives messages wirelessly from the jukebox computer and plays a song based on the message it received. It seems to only play sound on the computer+speaker closest to the jukebox computer.

Lupus590

Post your code and I'll look at it.

LostVint

Quote from: Lupus590 on Mar 08, 2021, 02:16 PMPost your code and I'll look at it.

https://github.com/LostVint/CCbaseDJ/tree/main

Here it is, I'm only 2 weeks into lua and 3 months into coding so it's probably way longer and jankier than it needs to be.

Lupus590

I'm going to assume that you have the peripherals in the right places.

I've also realised that if you have your base at very low y levels then you might be hitting the wireless modem distance limit, You could try having a few computers with the repeat program around.

I'm not seeing any obvious issues with the code, There are some places where it could be made cleaner, but that shouldn't be causing the issues that you are having.