BASS WMA - Detecting if Codec is installed

Started by Marras,

Marras

Hi Everyone!

I use BASS WMA to decode WMA-streams and play them in my application. On machines without the Windows Media Format modules installed, or Windows Media 7.1, I get an "Illegal Access" exception from windows when trying to call BASS_WMA_CreateStream. It seemes to crash only when reading the data from memory for some strange reason.

Anyway, it works fine if WMP7.1 is installed, or WMFADIST..

Is there a way to check if the Windows Media Format modules is installed, so that I can give my user a human readable error message? Perhaps to tell them what to do to make it work...

Delphi code appreciated!

Thanks in advance,
Marcus

Ian @ un4seen

hmm... I don't think BASSWMA.DLL will even load if the required modules aren't installed (Windows should complain about a missing WMVCORE.DLL). Is the WMVCORE.DLL file on those systems that crash?

Are you loading BASSWMA.DLL dynamically? If so, you should check that the LoadLibrary call is successful.

Marras

Yes, it is. I actually get the Access Violation error from within the WMVCORE.DLL.

I tested it on a cleanly installed Windows Millenium. I hadn't installed any updates at all, just plain Windows Me. It comes with WMP7.0.

Streaming from file worked, but streaming from memory didn't, but when I installed the WMFADIST.EXE-file, everything started working fine again. I guess this is caused by a bug in WMVCORE.DLL that is fixed in the new version that I installed?

Ian @ un4seen

I don't have WinME installed anywhere to test at the moment, but I believe the WMVCORE.DLL that comes with it is version 7.0.0.1440. I'm not sure if that version includes support for streaming from memory (actually IStream objects), or if it's just buggy.

The WMVCORE.DLL that comes in the WMFADIST is version 7.1.0.3055, so you could use that fact to check the DLL - ie. check that it's atleast version 7.1

Marras

You mean that I should extract the version information from the DLL?
Ok, I actually didn't think of that. Thanks!