hajimehoshi / go-mp3

An MP3 decoder in pure Go
Apache License 2.0
746 stars 81 forks source link

Switch implementation to minimp3 #21

Open hajimehoshi opened 6 years ago

hajimehoshi commented 6 years ago

https://github.com/lieff/minimp3

It looks like minimp3 is cleaner, faster and well tested. It is only about 1700 lines and switching to it is not so hard.

wsc1 commented 6 years ago

would switching mean use cgo?

hajimehoshi commented 6 years ago

I'd like to avoid using cgo, then no. Porting this to Go might be an option, but not decided yet.

pior commented 4 years ago

I just tested both implementation for a project running on RaspberryPi zero, on this platform the CPU usage is an important aspect:

Source mp3: 256kbps 44khz stereo

nadoo commented 4 years ago

I just tested both implementation for a project running on RaspberryPi zero, on this platform the CPU usage is an important aspect:

  • minimp3 -> ~35% of CPU
  • go-mp3 -> ~75% of CPU

Source mp3: 256kbps 44khz stereo

What about the speed? Read a mp3 file and save them to a pcm file.

joonas-fi commented 3 years ago

What about the speed? Read a mp3 file and save them to a pcm file.

An implementation using less CPU on a streaming load should always be faster in the task overall when scaling to "full throttle", i.e. to 100 % CPU.

Same variables, different perspective (speed and CPU usage are inherently related).