The pulsations of the B5IVe star HD 181231 observed with CoRoT and ground-based spectroscopy