Click here to Skip to main content
15,667,355 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I see a code to play a wav file:

TCHAR szMCIString[260];
TCHAR szDevType[245];
TCHAR szFileName[245];
MCIERROR dwReturn;
_stprintf(szMCIString,_T("open %s type %s alias MyWAV"),szFileName,    szDevType);
dwReturn = mciSendString(szMCIString, NULL, 0, NULL);

my file is E:\\v.mp3, but it can't play this file. so i use getlasterror to get error

TCHAR szError[128];
   //mciSendCommand(mciDevID, MCI_CLOSE, 0, 0L);
   mciGetErrorString(dwReturn, szError, 128);
   MessageBox(NULL,szError, L"Error", MB_OK);

the error receive is "The specified file device is not or is not recognized by MCI. :confused:
HELP ME! :((
Updated 28-Apr-10 1:12am

Why do you think "v.mp3" is a wave file?
Share this answer
oh! sorry, this isn't my error code.

my code is wcscpy(szFileName,L"E:\\v.wav"); but it is in error! thanks for help.

PS: how i can play mp3 file, MCI is not have a format for mp3.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900