Viet Phan X

[⚠️ JOURNEY] Building MP3 AI Manager for Music Hoarders (Day 17)

Author AvatarViet Phan
0
Jan 7, 2025
2 min read

Day 17

Hours worked/Total: 4.5/30

Day Recap

Faced several challenges while working on audio playback and waveform visualization. Learned how to handle blocking UI issues with multithreading and made some progress with basic waveform generation, though the results are far from ideal.

What I Did

  • Loading MP3 into memory:
    • Tried to preload the MP3 file into memory to avoid HDD warm-up delays but discovered that NAudio only supports playback directly from a file path. Decided to pause this effort for now.
  • UI blocking issue:
    • Encountered a problem where synchronous functions were freezing the UI.
    • Learned about Task.Run in C# for executing functions on a separate thread, similar to goroutines in Golang - Great to know this for future performance optimizations!
  • Adding a waveform:
    • Discovered that NAudio doesn’t support built-in waveform generation.
    • Integrated a third-party plugin for waveform visualization with some caveats.
      • Waveform generation takes a few seconds.
      • The resulting image is static, with no ability to skip through the track using the cursor.
      • The colors and design are ugly af.
  • Extracting MP3 metadata:
    • Started exploring how to retrieve metadata.
    • Found that default options in NAudio are limited to the file path and name. Extracting other details like meta tags requires additional libraries or custom solutions.

Remarks

This was a mixed day. Waveform rendering feels like a letdown compared to those you see in professional DJ softwares. Multithreading is a game-changer, and learning to offload blocking operations to a separate thread will be handy.

Next Goals

Make waveform better looking.

πŸ‘¨β€πŸ’» Software DevelopmentπŸš€ Journey

Got an Idea?

Let's Build It!

I can bring your ideas to life - FREE of charge

Book a free consultation and let’s identify opportunities to turn your vision into a successful business

15 min call

Get idea feedback

from 17+ consultations
?
Usually responds within 24h

If You Like what I do
You can buy me a coffee πŸ‘‡
Send β˜• via PayPalSend β˜• with Bitcoin

πŸ€™ Let's connect

Made by Viet Phan Β© 2018-2025Privacy Policy