CF2 PlaySound

  • Thread starter Thread starter Harry Simpson
  • Start date Start date
H

Harry Simpson

Should all the sound code used in CF 1.1 still work in CF 2.0? Any changes?
Or is there a better way to produce sound on the device?

TIA
Harry
 
Same code works. "Better" is subjective - depends opn what you need to do.
PlaySOund is simple, but not robust. It works for a lot of situations.

-Chris
 
Thanks Chris - I'm using embedded wav files then doing the
Dim snd As New
Sound([Assembly].GetExecutingAssembly.GetManifestResourceStream("EasyIDMOBILE.ding.wav"))

snd.Play()

But it's coming back as a Null Reference error from within the Sound class.
Kinda hard to debug.....just wondered if anything changed. Basically all I
want to do is play a short sound say if a patient is found. Same code works
in VS2003 environment so i'm a bit miffed.

Probably something stupid I'm doing.

Harry
 
Most likely the resource name is incorrect. It's case sensitive and needs
the fully qualified namespace. Go through GetManifestResourceNames and see
if you can find it to verify you have the name right.


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--


Harry Simpson said:
Thanks Chris - I'm using embedded wav files then doing the
Dim snd As New
Sound([Assembly].GetExecutingAssembly.GetManifestResourceStream("EasyIDMOBILE.ding.wav"))

snd.Play()

But it's coming back as a Null Reference error from within the Sound
class. Kinda hard to debug.....just wondered if anything changed.
Basically all I want to do is play a short sound say if a patient is
found. Same code works in VS2003 environment so i'm a bit miffed.

Probably something stupid I'm doing.

Harry

Same code works. "Better" is subjective - depends opn what you need to
do. PlaySOund is simple, but not robust. It works for a lot of
situations.

-Chris
 
Thanks Chris - yup something stupid - I had it mixed case yet different.

Thanks
Harry

Hey If I send you a million bucks will you write another book ;-)

Most likely the resource name is incorrect. It's case sensitive and needs
the fully qualified namespace. Go through GetManifestResourceNames and
see if you can find it to verify you have the name right.


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--


Harry Simpson said:
Thanks Chris - I'm using embedded wav files then doing the
Dim snd As New
Sound([Assembly].GetExecutingAssembly.GetManifestResourceStream("EasyIDMOBILE.ding.wav"))

snd.Play()

But it's coming back as a Null Reference error from within the Sound
class. Kinda hard to debug.....just wondered if anything changed.
Basically all I want to do is play a short sound say if a patient is
found. Same code works in VS2003 environment so i'm a bit miffed.

Probably something stupid I'm doing.

Harry

Same code works. "Better" is subjective - depends opn what you need to
do. PlaySOund is simple, but not robust. It works for a lot of
situations.

-Chris


Should all the sound code used in CF 1.1 still work in CF 2.0? Any
changes? Or is there a better way to produce sound on the device?

TIA
Harry
 
Back
Top