I just tried it that way: Var pcmd: String; MyFileName: String; pcmd:='play "'+MyFileName+'"'+#0; mciSendString(@pcmd[1],Nil,0,0); I get the same results, files with no spaces in the name even long file names play fine, if there's spaces, they won't play. I had the idea to just get the windows short file name and pass it on to play the sound instead of bothering to figure out why spaces won't work. I found getshortpathname: https://www.freepascal.org/daily/packages/winunits-jedi/jwawinbase/getshortp athname.html function GetShortPathName( lpszLongPath: LPCTSTR; lpszShortPath: LPTSTR; cchBuffer: Windows.DWORD ):Windows.DWORD; does anyone know how to convert a pascal string to the LPCTSTR needed for the long path and then how to convert the LPTSTR short path to LPCTSTR for mciSendString? Are the LPCTSTR and LPTSTR just PChar strings or something else? James >I've only ever done this like: > >pcmd: string; > >pcmd:='open "'+filename+'" ... '+#0; > >mciSendString(@pcmd[1], ...);
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal