I'm spitting up a clear mucus with brown speckles or brown something in it what could it be?

Old blood. The brown specks may be blood. It could be coming from your nose, throat, stomach or lungs. Get it evaluated if it persists.
Infection? It could be an infection, though if you smoke, or ever have smoked, you could be coughing up small tobacco particles. You could benefit from a sputum culture, so see your family doctor.