Click to See Complete Forum and Search --> : Sound


Entelecheia
10-08-2003, 07:55 AM
I have been attempting to use low-level sound facilities in Windows CE from .NET in C#. However, when ever I try to call the 'waveOutOpen' function I get a ' NotSupportedException' (details below). Does anybody have any ideas?

I have checked the data-structures I am passing to the function against a working program that runs on my desktop machine. I am sure that they are correct. I have also ported the code produced by Ianier Munoz (http://www.codeproject.com/cs/media/cswavplay.asp) to the Pocket PC and exactly the same error occurs! Ianier's code works very well on the desktop machine and I have confidence in it. This suggests that there is some subtle difference with the 'waveOutOpen' function in the compact framework.

All I want to do is create a simple C# class that enables me to play multiple sounds simultaneously on the Pocket PC. The C++ code by Fabricio Kury (http://www.pocketpcdn.com/articles/multiplewaves.html) has been very helpful and I have 'borrowed' code fragments from Ianier. But I can't make it work!

This sounds like such an obvious thing to do I can't think why nobody else has done it.

Perhaps somebody could produce a DLL from Fabricio Kury's code and I could call that from C#.

Any ideas or help gratefully received!

Rob



NotSupportedException Class
The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality.
For a list of all members of this type,

Remarks
There are methods that are not supported in the base class, with the expectation that these methods will be implemented in the derived classes instead. The derived class might implement only a subset of the methods from the base class, and throw NotSupportedException for the unsupported methods.

NotSupportedException is also thrown by System.IO classes whenever there is an attempt to read, seek, or write to a stream that does not support the invoked functionality

http://www.codeproject.com/cs/media/cswavplay.asp