A laser spectroscopy based method for the detection of acidic compounds in solution