how to play mp3 in c++?
plz give me some example codes if you can:)

hey, you can play mp3 files in your program like this:

HWND m_Video = MCIWndCreate(hWnd, GetModuleHandle(NULL), WS_CHILD | WS_VISIBLE | MCIWNDF_NOPLAYBAR | MCIWNDF_NOMENU, _T("C:\\123.mp3"));
MCIWndPlay(m_Video);

and then you should destroy the handle by using MCIWndDestroy:

MCIWndDestroy(m_Video);

oh and also you then should include vfw.h header file and vfw32.lib library:

#include <Vfw.h>
#pragma comment(lib, "vfw32.lib")
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.