Lose the 1 uF on the LED side. LED's are current operated non linear devices, they don't respond slowly with a cap across the LED, it just delays a fast turn on.
That's actually ideal for me then. Ideally I want there to be some "inertia" of sorts to turning that LED on so that it's a bit electrical noise immune with reduced risk of accidental turn ons, whilst also still turning the PMOS on fairly quickly.
I've probably not been clear enough through this about my issues/concerns-
1. Electrical/RF noise immunity - to stop it accidentally turning due to WiFi, DECT etc, or impulse noise. Hence the capacitor on the LED side. Maybe keep the capacitor but reduce it's value? Or just likely not needed or better way to do that?
2. General audio noise coming out of the 5V USB powered speaked. This doesn't matter now, as it's only for doing voice announcements very occasionally. 99.99% of the time it's going to be unused. Hence removing power, to make it proper quiet!
3. The switch on pop/click when the speaker powers up/down. Would be nice to reduce this.
The turn on time will be dominated by the 150 ohm emitter resistor.
Will it though? The current driving the LED is 2mA. The CTR of the optoisolator is min 200%, probably around 300%. So it's likely with 150ohm in series with the optocoupler transistor that it'll max at 4mA to 6mA ish, so it might not actually be saturated? Do I need another transistor there maybe to drive the current into the PMOS to improve the transition?
You don't want to stay in active region too long but a mS or two shouldn't be bad, many FET data sheets will have a graph of pulse duration and amplitude- involves transient thermal, etc. If you go too long you'll start dissipating real power in the PFET- poof. The gate is a big capacitor. Output Z of transistor is basically that emitter R (in parallel with collect load, but that is likely much larger). Gate C is probably 3000 pF (didn't look it up, remember that C=Q/v if you only have charge spec- this is an approximation, its not linear). Gate draws zero current after its pulled low (on), emitter R only matters in transition- will settle to gate at ground. Breadboard it and play with it.
Click and pop can be tough. Sometimes its just caused by bias circuits coming up and slowing Vcc rise down doesn't help. Often just biasing up the input C causes a thump. You might be able to put a high Z voltage divider on this node to keep bias on input C even when shutdown, so it doesn't get a big slug on power up. You can reduce this C value too- these amps size input coupling for 20Hz, which depending on your app might not matter (toll grade voice is ~300 to 3400 Hz). Does amp have mute input that is active on power up. You could put an RC on this input so amp muted on slew. If you have flexibility on amps, look at others- they vary widely
I've built a lot of audio players for ornithologists that play bird calls at certain times or on demand for various purposes. Two gotchas are to watch grounds and how ground current flows- don't let it contaminate your audio source- its common to get hum or digital noise in the audio. The other is peak currents drawn by audio. Bypass the amp well but don't have a FET driving a big low ESR cap directly (add an L), the current for a good cap can be really high with a fast step.
Good Luck.
I'm thinking that maybe a fuse on the 5V might be a way to both limit the turn on current too (as it'll have some inherent resistance, especially if low enough current, e.g. 650mA), I feel more comfortable if there's a fuse in anything I make, lol. The audio distortion aspect is neither here nor there really, as the speaker is only for doing voice announcements.