There are several scenarios. When did this error occur, was it recent? You can try a System Restore to revert your settings when WMP was working fine.
Another alternative is to download CCCP codec pack from here:http://www.cccp-project.net/
Then you can use Windows Media Player Classic.
You can also download VLC player which works on nearly all formats:http://www.videolan.org/vlc/index.html