Hi Salman - sorry for the delay in responding. I’ll assume you are using an Arduino in your product. If using another language or platform, make adjustments accordingly.
Here is a link to a typical relay hardware device that can be sourced from many vendors worldwide. I just provided this as an example unit. This one features a 5 volt coil and can be driven directly from a digital pin on an Arduino.
https://vetco.net/products/single-relay-module-for-arduino-d25/vupn5949
Here is some sample code as a guide:
/*
Speaker Control
Suppresses audio from reaching an amplifier or speaker until specific software control enables the relay.
Circuit - attach the relay module’s power pins for 5 volts and ground to a suitable source (Arduino 5 volt power
and ground pins).
Attach the relay module control pin tp Arduino digital pin 12 (OK to change this to any other digital pin)
Connect the speaker “hot” lead from the movi audio jack (that is the tip of the plug) to the relay common
pin.
Connect the movi speaker / amplifier ‘hot’ lead to the relay ‘open’ pin. Now the only time the audio output from the movi will reach the speaker / amplifier is when the Arduino commands the relay to operate.
good luck with your product!
Mike McLendon
*/
// Relay pin is controlled with D12
int relay = 12;
bool firstTime=true;
void setup() {
// Pin for relay module set as output
pinMode(relay, OUTPUT);
digitalWrite(relay, HIGH);// relay is operated and the audio hot lead is opened (not connected)- NO AUDIO!
// Serial communication for debugging purposes
Serial.begin(9600);
}
void loop() {
if(firstTime==true){ //do this once when the system starts up
firstTime=false;
delay(5000); // after 5 seconds,
digitalWrite(relay, LOW);// relay is turned off (released) now connecting the movi to the speaker / amp
Serial.println(“Relay is off and the audio is connected!”);
}