Record Speaker Line Out on a PC/Laptop/RaspberryPi or ESP32 - Page 1
Forum section: electronics / projects

author: circuitdoctor
author_rank: Newbie
timestamp: October 28, 2024, 08:04:59 pm
content: Hello EEV family,I am looking for a readily available circuit or a DIY solution where I have a speaker, I want to remove the speaker and convert this speaker into a audio line input so that any PC, laptop, Raspberry Pi or a ESP32 can consider it as a audio input and I can record the audio signal. Any help or starting point for this project would be appreciated.

author: Analog Kid
author_rank: Super Contributor
timestamp: October 28, 2024, 08:11:31 pm
content: Are you talking about converting a speaker output from an external device into an input to the Pi? or are you just adding a line-level input to the Pi? Not clear from what you posted.

author: circuitdoctor
author_rank: Newbie
timestamp: October 28, 2024, 08:18:14 pm
content: Thankyou for pointing it out @Analog Kid, yes I am looking to convert the output from a speaker (so there are these two wires SPKR+ and SPKR- that connects to it), I need a readily available circuit or a DIY circuit that takes these two inputs (SPKR+ and SPKR-) and converts them to a line-level acceptable as microphone input that any laptop or a raspberryPi can then record.

author: Analog Kid
author_rank: Super Contributor
timestamp: October 28, 2024, 08:25:25 pm
content: In that case a simple attenuator should work, something to just bring down the level of the speaker output like this:Use a 20K-50K pot and adjust it to a satisfactory level. Later if you want to eliminate the pot you could measure the two segments at the adjusted setting and make a voltage divider with 2 resistors of those values.Be aware that a microphone-level input isn't the same as a line-level one; the mike input will be much more sensitive. This solution should work even with a mike input, but will require careful adjustment not to overdrive the input.

author: circuitdoctor
author_rank: Newbie
timestamp: October 28, 2024, 08:28:31 pm
content: Are voltage level of concern here, or is there any readily available market circuit that converts the speaker line level to a microphone output for direct recording? I think (not sure) that the resistive attenuator might cause some loading effect.

author: Analog Kid
author_rank: Super Contributor
timestamp: October 28, 2024, 08:34:50 pm
content: A high-resistance pot/divider (say 20-50K) won't load the speaker output (typically 4-8 ohms) at all. This shouldn't be a problem for whatever's driving the speaker; if it is (that is, if the speaker-driving device wants to see a speaker load there), then you can just put a 10-ohm resistor across the speaker output before this attenuator as a dummy load.The divider will reduce the speaker voltage (input side) to a lower voltage acceptable to either a microphone or line-level input (after adjustment).The high value of the divider (actually the value of the "bottom" part) will be high enough to match the impedance of the mike/high-level input. In any case, it doesn't really matter: it's OK to drive a high-impedance input from a low-impedance source, but not the other way around.

author: circuitdoctor
author_rank: Newbie
timestamp: October 28, 2024, 08:39:50 pm
content: In my case (its basically a drive-thru base station). There is a speaker point on the PCB says SPKR+ and SPKR-. Bu the speaker is not connected physically. So lets say if we connect a 8-10 Ohm dummy load so that the circuit thinks a speaker is connected. But then our attenuator circuit comes in parallel with the speaker load (10 Ohm resistor) this will make the overall resistance less than the 10 Ohm resistance. How about any opamp based approach?

author: Sacodepatatas
author_rank: Regular Contributor
timestamp: October 28, 2024, 08:41:32 pm
content: Quote from: Analog Kid on October 28, 2024, 08:25:25 pmBe careful, because nowadays small voltage class D amps use BTL for increasing the output power. In this case, Speaker- is not ground. Also, these amps lack of LPF at the output so there must be a capacitor somewhere for integrating the high freq PWM.Edit: of course if you use separate isolated power suplies for each device (for instance, batteries), then you can safe connect SPKR- to ground.

author: Analog Kid
author_rank: Super Contributor
timestamp: October 28, 2024, 08:42:52 pm
content: You're overthinking this.The resistance of the attenuator (20-50KΩ) is so much greater than the speaker impedance (2-10Ω) that it won't make any difference. It'll be what they refer to as "swamped" by the low resistance, so no worries there.What exactly is this "drive-through base station"?

author: circuitdoctor
author_rank: Newbie
timestamp: October 28, 2024, 08:51:41 pm
content: I will give this method a try.Its a HME EOS|HD Drive Thru base station setup I ahve at my store. It uses a phantom powered microphone (+18v, +18v, GND) at the outdoor post where the client speaks and places the order. This microphone output can be played on a wireless headset that the order taker has and a speaker output (grill speaker) so all employees can hear the order.

author: Analog Kid
author_rank: Super Contributor
timestamp: October 28, 2024, 08:58:54 pm
content: Why don't you try my idea and see how it works? Pretty much zero chance of damaging anything; worst case would be it doesn't work (for reasons given here by @Sacodepatatas). But I'd bet on it working.An opamp solution would be complete overkill here.

author: circuitdoctor
author_rank: Newbie
timestamp: October 28, 2024, 08:59:52 pm
content: I will give it a try and comment on it here very soon.

author: circuitdoctor
author_rank: Newbie
timestamp: October 28, 2024, 09:09:44 pm
content: Quote from: Analog Kid on October 28, 2024, 08:58:54 pmI just red about the line output converters, what do you think using it would be a good idea?

author: Analog Kid
author_rank: Super Contributor
timestamp: October 28, 2024, 09:16:15 pm
content: Don't know anything about them; can you post a link?@Sacodepatatas: if the device does use a class D amp with speaker +/- isolated from ground as you wrote, do you think this would work to get around that problem? All high-value (~10K or more) resistors to avoid danger of loading the output.

author: circuitdoctor
author_rank: Newbie
timestamp: October 28, 2024, 09:18:04 pm
content: Here is a link to Line Output Converters (LOC)https://www.crutchfield.com/S-dBWouGp2g9W/learn/what-are-line-output-converters.html

author: Analog Kid
author_rank: Super Contributor
timestamp: October 28, 2024, 09:22:34 pm
content: Probly should be this instead:

author: radiolistener
author_rank: Super Contributor
timestamp: October 28, 2024, 10:24:15 pm
content: since speakers working with high voltage, you're needs to use protection diodes to avoid damage of your sound input port on notebook/pc/raspberry piSound input ports are designed 1-2V signals, while speakers can work with 12-50 V signal and even more, depends on power and impdeance

author: Analog Kid
author_rank: Super Contributor
timestamp: October 28, 2024, 10:52:55 pm
content: Quote from: circuitdoctor on October 28, 2024, 09:09:44 pmWhat I showed youisa line-output converter. The only thing that needs "converting" here is the voltage, which is reduced by the attenuator to an acceptable level for either a microphone or line-level input. No other "conversion" needed: no equalization, impedance matching, etc.Regarding the caution about high voltage damaging the amplifier input, that shouldn't be a problem since the attenuator will reduce the input voltage to a safe level. It needs to be carefully adjusted, and after that you can just "set and forget" it.

author: themadhippy
author_rank: Super Contributor
timestamp: October 28, 2024, 11:52:57 pm
content: QuoteA di box

author: Analog Kid
author_rank: Super Contributor
timestamp: October 29, 2024, 12:42:02 am
content: DI box?Looking at some online schematics, guess what? their input circuit does exactly what my (much simpler) suggestion does: attenuate the speaker output to a lower level:

author: Sacodepatatas
author_rank: Regular Contributor
timestamp: October 29, 2024, 03:39:29 am
content: Quote from: Analog Kid on October 28, 2024, 09:22:34 pmYes, This should work.Just take into account that the resistance combination of the parallel resistor and potentiometer shall be about the same value of the remaining resistor. The real ground for the line input would be somehow a "virtual ground" for the speaker output circuitry.