the mic pr-amp works a good white noise generator with no input.

Just a note, I was revamping an LM386 signal tracer I'd made a long time ago.
It's like your circuit but the input has a blocking capacitor with diode clamp, and a 1MEG pot. I add a 1000pF cap from pin 3 to GND to stop AM radio pickup. For headphones, I add an extra 100R resistor so my ears don't get blasted.
If sound quality is poor, dirty or gritty sounding - as always, the LM386 does like to burst oscillate around 13MHz. The output network 10R 0.1uF helps somewhat but the only fix I find is 2.2uF X7R ceramic cap right across Vcc and GND at pins 4,6. Without these, I've never had the LM386 behave itself.
note- the power rail 220uf electrolytic is right up next to the lm386, - may need to add an nf or two here as I do with voltage regulators circuits.

I have made some changes to the circuit after I tested it on a piezo but only got 50Hz AC noise.

and the line out part of the circuit, failed to work properly with the 10uf at the output.

did add a 2k maybe its to high, with a 600pf to clamp down the input of the mic pre-amp.

yes the sound quality is hard gritty sounding, the base boost circuit in the data sheet maybe the answer here.
I considered it to be too much low end boost, when looking at the data sheet. seeing the base hump, so disregarded it initially.
thinking that a level flat frequency response was the best choice here.

the other fix is the output 100uf is too low, no base & line out failed. more coupling on the output is needed.
adding a 200uf & lowering the gain is what is needed.
its problematic to remove some components as I compacted everything into the enclosure
cutting wire lengths to save space.
I may just start from scratch and plan it out butter on breadboard.
before stuffing everything into another enclosure.
all is not lost. I have a good little white noise generator
with some limited audio functionality
if you're interested the two toggle switches , RGB color LED and the potentiometer were mounted on a sub-panel
under the top panel that was held in place with 2mm bolts, covered in self adhesive film with a top clear layer of film over the text.