High-resolution pionic-atom x-ray spectroscopy was performed with an x-ray spectrometer based on a 240-pixel array of superconducting transition-edge-sensor (TES) microcalorimeters at the piM1 beam line of the Paul Scherrer Institute. X-rays emitted by pionic carbon via the 4f->3d transition and the parallel 4d->3p transition were observed with a full-width-at-half-maximum energy resolution of 6.8 eV at 6.4 keV. Measured x-ray energies are consistent with calculated electromagnetic values which considered the strong-interaction effect assessed via the Seki-Masutani potential for the 3p energy level, and favor the electronic population of two filled 1s electrons in the K-shell. Absolute energy calibration with an uncertainty of 0.1 eV was demonstrated under a high-rate hadron beam condition of 1.45 MHz. This is the first application of a TES spectrometer to hadronic-atom x-ray spectroscopy and is an important milestone towards next-generation high-resolution kaonic-atom x-ray spectroscopy.