delphimp3win64

Delphi: playing mp3 in 64-bit exe


Targeting Windows7+ systems, what's a simple way to play MP3s from my Delphi (10.2 Tokyo) app compiled in 64-bit? I had been using DSPack with 32-bit, but in 64-bit it won't compile. Had a look at BASS but it's also not working on 64-bit.

Preferably something working directly with the Windows API would be preferable over including external dlls with the app.


Solution

  • One simple way is to use mciSendString.

    uses
      Winapi.MMSystem;
    ....
    mciSendString('open audiofile.mp3 type mpegvideo alias song1', nil, 0, 0);
    mciSendString('play song1', nil, 0, 0);