Author Topic: MP3 Encoder  (Read 6953 times)

0 Members and 1 Guest are viewing this topic.

Offline hamdi.tnTopic starter

  • Frequent Contributor
  • **
  • Posts: 623
  • Country: tn
MP3 Encoder
« on: July 27, 2016, 11:16:31 am »
Hi everyone,

Am working on a project that involve streaming audio between two units, and client requirement is that it should be MP3 compression. So i tried some algorithm (shine , 8Hz and BladeEnc) first just compiling code and testing compression on my PC and the only one working fine with immediate result is BladeEnc. However the main objective is to be able to load that into an STM32 uC (429 for now , we my use an F7 later). am trying to optimize the code in order to do that and still working on it. My question is, have anyone here had experience with that, and can possibly share and is there any encoder tested by someone here on the blog that can point out.

Shine is supposed to be ARM compatible and designed to be light and quick, however i couldn't get a proper sounds with it, anyone did some testing with it ?

Thanks.
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
 

Offline hamdi.tnTopic starter

  • Frequent Contributor
  • **
  • Posts: 623
  • Country: tn
Re: MP3 Encoder
« Reply #3 on: July 27, 2016, 12:17:38 pm »
https://www.cirrus.com/en/pubs/proDatasheet/WM8731_v4.9.pdf

Am only concerned about the firmware part of this project , an other enginnering company made the choice for the hardware and for them external codec chip are not an option. External will my choice if am going to develop this, but not my call this time.
 

Offline hamdi.tnTopic starter

  • Frequent Contributor
  • **
  • Posts: 623
  • Country: tn
Re: MP3 Encoder
« Reply #4 on: July 27, 2016, 12:21:13 pm »
ST themselves provide an example (probably optimized).

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32-standard-peripheral-libraries-expansions/stm32-mp3nl-cod.html

Yap, not downloadable. i already asked for those library from ST representatives and support, still waiting for an answer. NDA need to be signed or some fees may need to be payed.
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: MP3 Encoder
« Reply #5 on: July 27, 2016, 01:29:11 pm »
Quote
i already asked for those library from ST representatives and support, still waiting for an answer. NDA need to be signed or some fees may need to be payed.
Sorry, did not realise you had already tried.

Yes, will probably need NDA simce anything from the MPEG library is tightly controlled by the MPEG body.

I believe there are free ports of the algorithm though. Have you searched 'stm32 mp3' - loads of projects come up.
 

Offline hamdi.tnTopic starter

  • Frequent Contributor
  • **
  • Posts: 623
  • Country: tn
Re: MP3 Encoder
« Reply #6 on: July 27, 2016, 01:58:47 pm »
Quote
i already asked for those library from ST representatives and support, still waiting for an answer. NDA need to be signed or some fees may need to be payed.
Sorry, did not realise you had already tried.

Yes, will probably need NDA simce anything from the MPEG library is tightly controlled by the MPEG body.

I believe there are free ports of the algorithm though. Have you searched 'stm32 mp3' - loads of projects come up.

yap i did, most of those project are decoder, while i still need that. i need the encoder as well.
The only useful codes i found are in this page
http://www.mp3-tech.org/programmer/encoding.html

 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: MP3 Encoder
« Reply #7 on: July 28, 2016, 06:33:20 am »
 

Offline hamdi.tnTopic starter

  • Frequent Contributor
  • **
  • Posts: 623
  • Country: tn
Re: MP3 Encoder
« Reply #8 on: July 29, 2016, 09:49:30 am »
No, i didn't. i saw so many people using LAME encoder, it's a bit complicated for me and i may need to implante a uLinux on the chip and that's even more complicated for me to do. :-// so am going to keep working with BladeEnc, and waiting for someone to share his experience here.  or i may share my code here is it works  ;D
 

Offline hamdi.tnTopic starter

  • Frequent Contributor
  • **
  • Posts: 623
  • Country: tn
Re: MP3 Encoder
« Reply #9 on: August 01, 2016, 01:11:35 pm »
Update : so after a lot of testing with BladeEnc, it worked yap , but it took 15 second to encode and transmit over serial link a 1s of raw audio. so a bit useless. i don't think it's worth the trouble to adapt it anymore to the STM32, i may drop the idea of MP3 encoding and use an open source codec with less complexity. Codec2 seems promising will try to work with it. other then that any idea ?
 

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 16647
  • Country: 00
Re: MP3 Encoder
« Reply #10 on: August 01, 2016, 01:51:55 pm »
Update : so after a lot of testing with BladeEnc, it worked yap , but it took 15 second to encode and transmit over serial link a 1s of raw audio. so a bit useless. i don't think it's worth the trouble to adapt it anymore to the STM32, i may drop the idea of MP3 encoding and use an open source codec with less complexity. Codec2 seems promising will try to work with it. other then that any idea ?

"Speech" codecs often work badly for non-speech.

What exactly is the "audio" you're transmitting? How many bits? What sample rate? What sort of sound? How much compression do you need?


 

Offline hamdi.tnTopic starter

  • Frequent Contributor
  • **
  • Posts: 623
  • Country: tn
Re: MP3 Encoder
« Reply #11 on: August 01, 2016, 02:05:05 pm »
Update : so after a lot of testing with BladeEnc, it worked yap , but it took 15 second to encode and transmit over serial link a 1s of raw audio. so a bit useless. i don't think it's worth the trouble to adapt it anymore to the STM32, i may drop the idea of MP3 encoding and use an open source codec with less complexity. Codec2 seems promising will try to work with it. other then that any idea ?

"Speech" codecs often work badly for non-speech.

What exactly is the "audio" you're transmitting? How many bits? What sample rate? What sort of sound? How much compression do you need?




it's speech, for audio quality am just trying to test various stuff and optimise it later.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3238
  • Country: gb
Re: MP3 Encoder
« Reply #12 on: August 01, 2016, 05:07:03 pm »
You might want to have a look at a linear predictive coding scheme such as CELP for speech.   CELP gives good quality speech at low bit rates and lower cpu overhead than MP3, especially for decoding.

There is an open source library called Speex that implements CELP, and an STM32 app note.
 

Offline Maddaid

  • Newbie
  • Posts: 1
  • Country: ai
Re: MP3 Encoder
« Reply #13 on: September 08, 2017, 09:13:41 am »
Quote
i already asked for those library from ST representatives and support, still waiting for an answer. NDA need to be signed or some fees may need to be payed.
Sorry, did not realise you had already tried.

Yes, will probably need NDA simce anything from the MPEG library is tightly controlled by the MPEG body.

I believe there are free ports of the algorithm though. Have you searched 'stm32 mp3' - loads of projects come up.
Sorry to bother sir, it seems that you know pretty well about audio format right? I also have a related question and would you mind my asking now. Recently I downloaded an audio file of .au from the internet but it could not be played by my Windows Media Player and VLC. I think it could not be recognized. Then, I thought about conversion to other formats and then I  downloaded  this audio converter (http://www.videoconverterfactory.com/tips/au-to-mp3.html)to convert AU to MP3 file. But as a noob, it is really difficult for me to understand some of the terminologies about audio formats. In the format and codec list, I do not literally know what to choose among  bit rate, sample rate and channels. Is it correct that the higher bit rate I set, the better the output will be?How about the sample rate, what is the difference between the bit rate and sample rate?
Modify message
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf