Skip to main content
RFlod.2
Senior
Jan 9, 2025 8:56 AM UTC
Question

Voice compressing in STM32L4

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?
This topic has been closed for replies.

9 replies

Danish1
Lead III
Jan 9, 2025 9:05 AM UTC

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
Senior
Jan 9, 2025 9:28 AM UTC

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.

unsigned_char_array
Lead III
Jan 9, 2025 3:02 PM UTC

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
Senior
Jan 13, 2025 9:39 AM UTC

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

unsigned_char_array
Lead III
Jan 13, 2025 7:06 PM UTC

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
Jan 15, 2025 3:48 PM UTC

Cortex-M4 is a superset of Cortex-M3.

JW