Simplest way to play a MP3 file on Windows

Windows specific questions.
angros47
Posts: 1535
Joined: Jun 21, 2005 19:04

Simplest way to play a MP3 file on Windows

Postby angros47 » Aug 02, 2019 23:12

If I want to play a MP3 file called myfile.mp3 , this is all the code needed.

Code: Select all

#include "Windows.bi"
#Include Once "crt/string.bi"
#include "win/mmsystem.bi"

?mciSendString("open myfile.mp3 type mpegvideo alias song1", NULL, 0, 0)
?mciSendString("play song1", NULL, 0, 0)
sleep
?mciSendString("close song1", NULL, 0, 0)
Tourist Trap
Posts: 2768
Joined: Jun 02, 2015 16:24

Re: Simplest way to play a MP3 file on Windows

Postby Tourist Trap » Aug 24, 2019 14:48

angros47 wrote:If I want to play a MP3 file called myfile.mp3 , this is all the code needed.

Code: Select all

#include "Windows.bi"
#Include Once "crt/string.bi"
#include "win/mmsystem.bi"

?mciSendString("open myfile.mp3 type mpegvideo alias song1", NULL, 0, 0)
?mciSendString("play song1", NULL, 0, 0)
sleep
?mciSendString("close song1", NULL, 0, 0)

Thanks, that's useful.

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 1 guest