Direct titration of carbon dioxide