Why is the DFT used for spectrograms rather than the DCT?
Let's define the N-point IDFT $y[n]$ of a signal $Y[f]$ as

$$\begin{align*}
y[n] &amp;= \sum\limits_{f=0}^{N-1} Y[f] e^{j2\pi n\,\frac{f}{N}},&amp; n\in \{0,\dots,N-1 \}\tag{1} 
\end{align*}$$
The DCT-II (which is most probably what we're looking at; the others are mathematically useful, but less nice to implement) $\mathbf{Y}[f]$:

$$\begin{align*}
\mathbf{Y}[f] &amp;= \sum\limits_{n=0}^{N-1} y[n] \cos\left(\pi (k+\frac12) \frac nN \right) ,&amp; f\in \{0,\dots,N-1\}\\
&amp;\text{which, Euler says, is}\\
&amp;= \frac12 \sum\limits_{n=0}^{N-1} y[n]\left(e^{j\pi (k+\frac12) \frac nN } + e^{-j\pi (k+\frac12) \frac nN }\right),&amp; f\in \{0,\dots,N-1\}\text.\tag{2}
\end{align*}$$

Now, calculating the inverse discrete Fourier of the discrete cosine transform becomes but a matter of diligence; calculating by inserting $(2)$ into $(1)$, you'll notice that the complex sinusoids are orthogonal w.r.t. the scalar product, ie. the sum over the element-wise products becomes zero for everything but the same exponents.