The Orbiters did not have a Cockpit Voice Recorder.
They originally had a pair of Ops Recorders as part of the telemetry system, that could record downlinked telemetry, including voice. This is what the post-failure voice was pulled off of in the Challenger accident.
The official NASA voice transcript of the Challenger accident states that it comes from
the Challenger operational recorder...
You can see the Ops Recorders in this diagram from the 1982 Press Manual and read an extensive description of them starting on page 389 of the manual.

In the case of the 2003 accident,
Neither of the ops recorders were recovered from the Columbia. Only
one of the two would have contained the telemetry data that was being
transmitted back from the orbiter during the re-entry flight. Because
the telemetry data was fairly complete up until the loss of signal, in
spite of the various anomalous, but brief, communications drop outs,
the retrieval of the missing ops recorder would not have added that
much new data. A payload data recorder also exists, but it does not
contain much in the way of re-entry flight information. It was not
recovered from the wreckage debris, either.
(emphasis mine)
From Volume 2, Appendix D19 of the CAIB report, page 536.
Yet another recorder, the OEX recorder was found in East Texas. See Do rockets, launch vehicles or spacecraft contain a black-box? This recorder contained vital data used in the accident investigation.
Eventually the Ops Recorders were replaced by Solid State Recorders (SSR) that served the same purpose. See page 2.4-10 in the Space Shuttle Crew Operations Manual.