Playing sound files in .net cf

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a question for you guys. I am making a program that plays individual
note sound files. Right now I am using .wav files and have it working using:

Public Declare Function PlaySoundW Lib "coredll.dll" Alias "PlaySoundW"
(ByVal lpszName As String, ByVal hModule As Integer, ByVal dwFlags As
Integer) As Integer

and I call this function 6 times in a row to play the sound files. However,
the way this works is that it will play one sound file, and once that file is
finished, then it will play the next, and so on. So you only hear one note
at a time. I don't want this. I want to make it so that it will play all 6
files at once. Or at least one instantly after the other but in a way where
they overlap so you are hearing all 6 notes together at one given point in
time. Do I need to declare 6 different functions so they can all be going at
the same time? Or would that even work since it would still be accessing the
same .dll?

Please help, thanks so much!

-Tim
 
Take a look at the flags passed to the function. My guess is that you
actually want to mix the sounds, and the PlaySound function isn't designed
for that. That's what the waveOutXXX APIs are for.

-Chris
 
Depending on what you mean by "mix", I think you understand what I'm trying
to do. I want to be able to play a combination of 6 random notes at the same
time so it sounds like a chord playing? Get it? So if I need to look into
waveoutXXX APIs, how do I do that? Could you please give me some information
on how to use those, websites with sample code etc.? That would be so great!

Thank you so much!

-Tim
 
Tim,
I'm also on a project to play wav sound upon error occurs. Can you please
guide to a full sample of how to declare, using what and how to issue the
play sound.

Thanks a lot.

Rdgs,
Joshua
 
Back
Top