Click here to Skip to main content
13,090,730 members (42,490 online)
Rate this:
Please Sign up or sign in to vote.
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! :((
Posted 28-Apr-10 0:34am
Updated 28-Apr-10 1:12am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Why do you think "v.mp3" is a wave file?
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 28 Apr 2010
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100