HydrogenAudio

Lossy Audio Compression => MP3 => Topic started by: jim lee on 2019-01-09 22:58:09

Title: mp4 -> mp3 ?
Post by: jim lee on 2019-01-09 22:58:09
Hello, just discovered this forum looking at mp3 stuff.

I'm writing code for an mp3 player. It already works great for playing mp3s. Well, pretty good. It basically just opens up an mp3 file and feeds it block by block to the player hardware. My job is mostly GUI-> Hardware.

I run across a LOT of mp4 files. I can convert them to mp3 by hand, by just exporting them from things like iTunes etc. But it would be a lot nicer, if not terribly difficult, to be able convert them on the fly.

Is this mp4->mp3 a thing? Is it, "Oh no problem. Just do.." or is it a "Good lord man, are you nuts?" kind of thing?

Thanks millions!

-jim lee
Title: Re: mp4 -> mp3 ?
Post by: m14u on 2019-01-09 23:15:10
[...] I can convert them to mp3 by hand, by [...]
What's stopping you to live a normal life with mp4 ? Why you need convert mp4 (aac? lossy) to mp3 (worst lossy) ?
Title: Re: mp4 -> mp3 ?
Post by: DVDdoug on 2019-01-10 03:44:17
Most software-players can play MP3 and MP4 (as well as other formats).

Quote
Is this mp4->mp3 a thing?
Yes, you can convert MP4 to MP3 but it's "bad practice" unless you have a good reason because you may get worse quality than if you were to convert to MP3 from the lossless original.    (In theory you do get "worse quality" but it's all lossy and we can't say the quality is worse unless it sounds worse and in some cases it may not sound any different.)

Quote
But it would be a lot nicer, if not terribly difficult, to be able convert them on the fly.
It doesn't make sense to convert to MP3 on-the-fly because you'd be decompressing the MP4, re-compressing as MP3, and immediately decompressing and playing the MP3...  You might as well just play the MP4 after decompressing it the 1st time.    
Title: Re: mp4 -> mp3 ?
Post by: jim lee on 2019-01-10 03:48:03
I can't play the  mp4, I'm constrained by the hardware. .mp3, .ogg & i think .wav. If I want to play it, I need to have it in one of these formats.

-jim lee
Title: Re: mp4 -> mp3 ?
Post by: jim lee on 2019-01-10 04:01:14
Ok, wait. New world for me here. I just went and looked at the actual chip the hardware I have is based on..

Its the VS1053

And I read..

"MPEG4 / 2 AAC-LC(+PNS), HE-AAC v2 (Level 3) (SBR + PS)" <- Not sure what all the different things here mean, but I'm betting its saying if I can get mp4 data to it, it'll play it. Am I right ?

Thanks!

-jim lee
Title: Re: mp4 -> mp3 ?
Post by: DVDdoug on 2019-01-10 21:41:42
Quote
I'm betting its saying if I can get mp4 data to it, it'll play it. Am I right ?
Yes it should!  I don't know anything about that chip but it looks like it supports "almost everything".

I misunderstood what you were doing...   I didn't know you were using a specialized chip with CODECs built-into the firmware…   I thought someone else was writing the CODECs and you were in charge of the user interface.
Title: Re: mp4 -> mp3 ?
Post by: jim lee on 2019-01-12 08:06:40
I'm messing with that mp3 player chip and a cellphone chip. The cellphone chip is like a Swiss army knife. I had no idea that its a common thing to have FM radio tuners built into them. You can listen to the radio if you know the right commands. Or, tell if your signal's being jammed by someone. I wonder who decided that needed to be rolled in there?

Anyway, thanks for the help!

-jim lee
Title: Re: mp4 -> mp3 ?
Post by: polemon on 2019-01-13 22:46:38
Well, an MP4 is a container, capable of containing a bunch of audio codecs. Actually, MP4 can contain MPEG-2 Level-3 Part-3 ("MP3") Audio. From the specs of the audio chip, it seems it should decode almost all variations of AAC, which is most commonly found in MP4 files.

I'm assuming this is the Datasheet: http://www.produktinfo.conrad.com/datenblaetter/1500000-1599999/001516575-da-01-en-VS1053_CODEC___MICRO_SD_BREAKOU_1381_ADA.pdf

As you can see, it supports pretty much all contemporary audio codecs, including FLAC, Ogg/Vorbis, and pretty much all that goes into MP4 files.