473,395 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Multiple sounds in c# using .NET Compact Framework

I have been trying for 3 weeks now to make multiple sounds
at once using C# targetted to a pocket PC using visual
studio 2003. I have been blocked at every turn - mostly
because of the mismatch between the managed code model of
c# and the underlying CE API and its c++ flavour.

All I want to do is play more than one wav file at once. I
can't think why playSound was not designed to allow this.
However, using the various 'wave' functions is also very
difficult. I tried to translate the code at
http://www.pocketpcdn.com/articles/multiplewaves.html into
c# and failed. I tried using the OpenNetCF wrapper and
failed.

The wave functions want nice pointers to blocks of memoery
containing the data and c# just hates doing this! For
example, the OpenNetCF wrapper exepects an IntPtr
parameter as a pointer to a function. C# wants it to be a
delegate - but I can find no method of converting one to
the other! I know that secretly the delegate is a function
pointer - but can I pass it as a parameter to the wave
functions? No way? So I can't make it do a callback.

Please, somebody smart show me that it is really easy to
make multiple sounds at once using c# .NET . Show me that
I really can call low level wave functions. Tell me how to
convert a delegate to an IntPtr. Anything in fact that
helps me overcome the barrier between managed code and the
rest of the facilties on my little pocket pc!

Regards

Rob

Nov 15 '05 #1
2 4205
-----Original Message-----
I have been trying for 3 weeks now to make multiple soundsat once using C# targetted to a pocket PC using visual
studio 2003. I have been blocked at every turn - mostly
because of the mismatch between the managed code model of
c# and the underlying CE API and its c++ flavour.

All I want to do is play more than one wav file at once. Ican't think why playSound was not designed to allow this.
However, using the various 'wave' functions is also very
difficult. I tried to translate the code at
http://www.pocketpcdn.com/articles/multiplewaves.html intoc# and failed. I tried using the OpenNetCF wrapper and
failed.

The wave functions want nice pointers to blocks of memoerycontaining the data and c# just hates doing this! For
example, the OpenNetCF wrapper exepects an IntPtr
parameter as a pointer to a function. C# wants it to be a
delegate - but I can find no method of converting one to
the other! I know that secretly the delegate is a functionpointer - but can I pass it as a parameter to the wave
functions? No way? So I can't make it do a callback.

Please, somebody smart show me that it is really easy to
make multiple sounds at once using c# .NET . Show me that
I really can call low level wave functions. Tell me how toconvert a delegate to an IntPtr. Anything in fact that
helps me overcome the barrier between managed code and therest of the facilties on my little pocket pc!

Regards

Rob

.

Nov 15 '05 #2
I think that you want to look into using the managed wrappers for
DirectX 9. DirectX should allow you to play more than one sound at once,
easily.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<an*******@discussions.microsoft.com> wrote in message
news:48****************************@phx.gbl...
-----Original Message-----
I have been trying for 3 weeks now to make multiple

sounds
at once using C# targetted to a pocket PC using visual
studio 2003. I have been blocked at every turn - mostly
because of the mismatch between the managed code model of
c# and the underlying CE API and its c++ flavour.

All I want to do is play more than one wav file at once.

I
can't think why playSound was not designed to allow this.
However, using the various 'wave' functions is also very
difficult. I tried to translate the code at
http://www.pocketpcdn.com/articles/multiplewaves.html

into
c# and failed. I tried using the OpenNetCF wrapper and
failed.

The wave functions want nice pointers to blocks of

memoery
containing the data and c# just hates doing this! For
example, the OpenNetCF wrapper exepects an IntPtr
parameter as a pointer to a function. C# wants it to be a
delegate - but I can find no method of converting one to
the other! I know that secretly the delegate is a

function
pointer - but can I pass it as a parameter to the wave
functions? No way? So I can't make it do a callback.

Please, somebody smart show me that it is really easy to
make multiple sounds at once using c# .NET . Show me that
I really can call low level wave functions. Tell me how

to
convert a delegate to an IntPtr. Anything in fact that
helps me overcome the barrier between managed code and

the
rest of the facilties on my little pocket pc!

Regards

Rob

.

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: William Ryan | last post by:
If you download the code for MS Press Microsoft .NET Compact Framework by Wigley and Wheelwright in Chapter 11 there's code to handle this. If you haven't bought the book----TRUST ME, BUY IT. In...
2
by: Hans Kesting | last post by:
Is it possible to mix code meant for the CompactFramework and code meant for the standard framework? We are trying to make PDA and light-weight "laptop" versions of one application. This means a...
25
by: lucas_denoir | last post by:
I'm having some serious trouble accessing a virtual method of a base class - that is not the immidate base class. This is the basic situation that I have: ...
0
by: Roland Rosier | last post by:
Hello, I am trying to understand Managed C++ and the .Net Framework, and as far as I can tell, you add a /CLR option to the compiler to make it generate MSIL from C++. However, I need to...
7
by: charliewest | last post by:
Using .Net CF, i have created a 2 dimension ArrayList, and "binded" this list to a ComboBox control using the "DataSource" property. I have set the DisplaySource and ValueMember properties as well....
5
by: brett | last post by:
When I do Console.Write("something here") or WriteLine() on the Compact Framework, nothing appears in the output window. I have also tried it on another developer's machine with the same results. ...
9
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and...
10
by: Neville Lang | last post by:
Hi all, Here is a problem I first struck a while back in the Compact Framework. I am now using the full Framework (v2.0) and wanted to know whether there is anyway around this issue without...
3
by: Greg | last post by:
Hello all, I am looking to download an image from a website from within a compact framework pda app. I have tried everything I could find and thus I turn to you. Any help or suggestions would be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.