Skip to main content
RFlod.2
Associate III
January 9, 2025
Question

Voice compressing in STM32L4

  • January 9, 2025
  • 3 replies
  • 1367 views
I need to compress voice in STM32L4. Here are my requirements:
* STM32L4 run at maximum 80 MHz
* Voice to be sampled by ADC/DMA
* Flash usage for voice compression < 50 kBytes
* RAM usage for voice compression < 64 kBytes
* Compressed data < 10% of orignal data
* Compress library shall not be GPL (cannot disclose all source code in my project)
* Compressed voice need to be decompressed at Linux OS
 
 
So I have searched some libraries and here are my findings:
* ST Opus Cube
- Flash size to big, 163 kBytes
* Speex_STM32_master
- GPL license
* STM32F10x_AN2812_FW_V2.0.0 (speex library)
- Contains assembler files for STM32F1
*  ST X-CUBE-AUDIO
- Only for STM32F4 and STM32F7
 
So non of these solutions fits my requirements. Any other ideas?

3 replies

Danish1
Lead III
January 9, 2025

Stm32F1 and stm32L4 both have arm cortex M processors.

What problems do you get offering the STM32F1 assembly files to an assembler for L4?

RFlod.2
RFlod.2Author
Associate III
January 9, 2025

STM32F1 uses M3 core

STM32L4 uses M4 core

I do not want to put a lot effort into getting it to work if there is an obvious issue.

Lead III
January 9, 2025

Opus is BSD licensed. If that works for you you can use a non-ST port/implementation of OPUS.

https://opus-codec.org/license/
https://github.com/xiph/opus

 

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."
RFlod.2
RFlod.2Author
Associate III
January 13, 2025

Problem with Opus is the flash size, not the license.

Lead III
January 13, 2025

Have you tried porting the speex library? What assembler files need to be ported? I can't find the example.

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."
waclawek.jan
Super User
January 15, 2025

Cortex-M4 is a superset of Cortex-M3.

JW