The speciation of CO2 in dacite, phonolite, basaltic andesite, and alkali silicate melt was studied by synchrotron infrared spectroscopy in diamond anvil cells to 1,000 degrees C and more than 200 kbar. Upon compression to 110 kbar at room temperature, a conversion of molecular CO2 into a metastable carbonate species was observed for dacite and phonolite glass. Upon heating under high pressure, molecular CO2 re-appeared. Infrared extinction coefficients of both carbonate and molecular CO2 decrease with temperature. This effect can be quantitatively modeled as the result of a reduced occupancy of the vibrational ground state. In alkali silicate (NBO/t = 0.98) and basaltic andesite (NBO/t = 0.42) melt, only carbonate was detected up to the highest temperatures studied. For dacite (NBO/t = 0.09) and phonolite melts (NBO/t = 0.14), the equilibrium CO2 + O2- = CO32- in the melt shifts toward CO2 with increasing temperature, with ln K = - 4.57 (+/-1.68) + 5.05 (+/-1.44) 10(3) T-1 for dacite melt (Delta H = -42 kJ mol(-1)) and ln K = - 6.13 (+/-2.41) + 7.82 (+/-2.41) 10(3) T-1 for phonolite melt (Delta H = - 65 kJ mol(-1)), where K is the molar ratio of carbonate over molecular CO2 and T is temperature in Kelvin. Together with published data from annealing experiments, these results suggest that Delta S and Delta H are linear functions of NBO/t. Based on this relationship, a general model for CO2 speciation in silicate melts is developed, with ln K = a + b/T, where T is temperature in Kelvin and a = - 2.69 - 21.38 (NBO/t), b = 1,480 + 38,810 (NBO/t). The model shows that at temperatures around 1,500 degrees C, even depolymerized melts such as basalt contain appreciable amounts of molecular CO2, and therefore, the diffusion coefficient of CO2 is only slightly dependent on composition at such high temperatures. However, at temperatures close to 1,000 degrees C, the model predicts a much stronger dependence of CO2 solubility and speciation on melt composition, in accordance with available solubility data.