# MP3 codec round trip encode decode possible?

**URL:** <https://forum.juce.com/t/mp3-codec-round-trip-encode-decode-possible/47353>\
**Category:** Audio Plugins\
**Created:** [August 16, 2021, 1:26am UTC](https://forum.juce.com/t/mp3-codec-round-trip-encode-decode-possible/47353 "2021-08-16T01:26:46Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![unclefreddie70](https://avatars.discourse-cdn.com/v4/letter/u/3e96dc/32.png) [@unclefreddie70](https://forum.juce.com/u/unclefreddie70)\
**Post date:** [August 16, 2021, 1:26am UTC](https://forum.juce.com/t/mp3-codec-round-trip-encode-decode-possible/47353/1 "2021-08-16T01:26:46Z")

</div>

Hi,

I want to write a dead simple JUCE plugin to take input, convert it to a 128kbps MP3 stream internally, then de-convert back to audio on the output. The goal is a simple way to hear how a basic streaming service might affect the audio. Can anyone point me in the right direction for this?

I have some experience with JUCE; I have written a simple mono to stereo plugin that I love to death and I use on everything. But I cannot seem to find anything related to MP3 codecs.

Thanks,  
Fred

---

<div class="post-metadata">

**Author:** ![anoesisaudio](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/anoesisaudio/32/1132_2.png) [@anoesisaudio](https://forum.juce.com/u/anoesisaudio)\
**Post date:** [August 16, 2021, 1:38am UTC](https://forum.juce.com/t/mp3-codec-round-trip-encode-decode-possible/47353/2 "2021-08-16T01:38:02Z")

</div>

You probably want LAMEEncoderAudioFormat.

[https://docs.juce.com/develop/classLAMEEncoderAudioFormat.html#details](https://docs.juce.com/develop/classLAMEEncoderAudioFormat.html#details)

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [August 16, 2021, 1:47am UTC](https://forum.juce.com/t/mp3-codec-round-trip-encode-decode-possible/47353/3 "2021-08-16T01:47:52Z")

</div>

That is not suitable for real time processing of the sound, which the original poster wants.

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [August 16, 2021, 1:50am UTC](https://forum.juce.com/t/mp3-codec-round-trip-encode-decode-possible/47353/4 "2021-08-16T01:50:35Z")

</div>

This plugin idea seems to come up in various forums every now and then. It’s not at all a simple plugin to implement, but might be possible if you are willing to tolerate quite a lot of latency. You will probably also need to use the mp3 encoders and decoders directly, I think the Juce classes are not suitable for implementing that kind of a real time plugin.

---

<div class="post-metadata">

**Author:** ![LukeM1](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@LukeM1](https://forum.juce.com/u/LukeM1)\
**Post date:** [August 16, 2021, 10:14am UTC](https://forum.juce.com/t/mp3-codec-round-trip-encode-decode-possible/47353/5 "2021-08-16T10:14:43Z")

</div>

The JUCE codec code is suitable for reading/writing audio files, not for real-time encoding/decoding of audio streams. There are existing products which can do this for you in real-time, which I’m happy to shamelessly self-promote if necessary!

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [August 16, 2021, 11:22am UTC](https://forum.juce.com/t/mp3-codec-round-trip-encode-decode-possible/47353/6 "2021-08-16T11:22:39Z")

</div>

> [@LukeM1](#):
>
> which I’m happy to shamelessly self-promote if necessary!

I am interested, so please do. Is that available with JUCE interfaces? like AudioSource? or what do you use?

---

<div class="post-metadata">

**Author:** ![unclefreddie70](https://avatars.discourse-cdn.com/v4/letter/u/3e96dc/32.png) [@unclefreddie70](https://forum.juce.com/u/unclefreddie70)\
**Post date:** [August 16, 2021, 1:32pm UTC](https://forum.juce.com/t/mp3-codec-round-trip-encode-decode-possible/47353/7 "2021-08-16T13:32:11Z")

</div>

Thank you for clarifying, this is info I needed.

---

<div class="post-metadata">

**Author:** ![LukeM1](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@LukeM1](https://forum.juce.com/u/LukeM1)\
**Post date:** [August 16, 2021, 1:38pm UTC](https://forum.juce.com/t/mp3-codec-round-trip-encode-decode-possible/47353/8 "2021-08-16T13:38:56Z")

</div>

We collaborated with Fraunhofer directly to create products which do exactly what the OP was discussing:

[https://www.sonnox.com/plugin/fraunhofer-pro-codec](https://www.sonnox.com/plugin/fraunhofer-pro-codec)  
[https://www.sonnox.com/plugin/codec-toolbox](https://www.sonnox.com/plugin/codec-toolbox)

Obviously the code is not available publicly, which I think is perhaps what you were asking! But if you’re looking for an existing product to get that end result as a user…

---

<div class="post-metadata">

**Author:** ![unclefreddie70](https://avatars.discourse-cdn.com/v4/letter/u/3e96dc/32.png) [@unclefreddie70](https://forum.juce.com/u/unclefreddie70)\
**Post date:** [August 16, 2021, 1:44pm UTC](https://forum.juce.com/t/mp3-codec-round-trip-encode-decode-possible/47353/9 "2021-08-16T13:44:00Z")

</div>

Thank you for clarifying, this is info I needed.

Damn it, I deleted my original reply trying to figure out how to reply with quoting.

---

<div class="post-metadata">

**Author:** ![unclefreddie70](https://avatars.discourse-cdn.com/v4/letter/u/3e96dc/32.png) [@unclefreddie70](https://forum.juce.com/u/unclefreddie70)\
**Post date:** [August 16, 2021, 1:53pm UTC](https://forum.juce.com/t/mp3-codec-round-trip-encode-decode-possible/47353/10 "2021-08-16T13:53:14Z")

</div>

Thanks. I was aware of the Sonnox products. Since all I wanted was a dead simple 128kbps round trip, I wanted to write it myself. They do look like well-designed products, though.
