We present and evaluate an algorithm that performs in-call selection of the most appropriate audio codec given prevailing conditions on the network path between the endpoints of a voice call. We have studied the behaviour of different codecs under varying network conditions, in doing so deriving the impairment factors for non-ITU-T codecs so that the E-model can be used to assess voice call quality for them. Moreover, we have studied the drawbacks of codec switching from the end user perception point of view; our switching algorithm seeks to minimise this impact. We have tested our algorithm on different packages that contain a selection of the most commonly used codecs: G.711, SILK, ILBC, GSM and SPEEX. Our results show that in many typical network scenarios, our switching codecs mid-call algorithm results in better Quality of Experience (QoE) than would have been achieved had the initial codec been used throughout the call.