Playing sound files in .net cf

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
 
G

Guest

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
 
G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Declare Error 1
Sound play problem! 2
playing wma files 2
IPhone sound quality gets worse each generation 5
Register HotKey 0
Assign a sound to a variable 19
Playing wavfiles from excel 3
Alarm 2 2

Top