This paper presents an optimization, and a real-time implementation of a wavelet based speech compression system in STM32F4 discovery card. The optimization is done on the one hand by considering a Voice Activity Detection (VAD) to reduce the complexity and on the other hand by using a new quantization approach that codes each sample with fewer bits. The performance of the embedded audio codec is evaluated with a test technique called Processor-in-the-Loop (PIL) and using objective measures that can predict the perceived quality of the signal, namely SNR, PSNR and MSE. The compression efficiency is measured with the compression factor (CR). This research highlights the importance of the proposed optimizations. Indeed, they increase the CR without damaging the voice quality. The practical study shows that the proposed system meets the temporal and material requirements. Voice clarity is assessed with the Mean Opinion Score (MOS).