Playsound loop not working

T

tamarindm

I need to play a .wav file over and over again. I am using the
following code.

[DllImport("winmm.dll")]
private static extern bool PlaySound( string lpszName, int hModule, int
dwFlags );

public int SND_ASYNC = 0x0001; // play asynchronously
public int SND_LOOP = 0x0008; // loop the sound until next
PlaySound

PlaySound( wavfile, 0, (SND_ASYNC | SND_LOOP));

But it plays only once and stop. Any idea what's wrong ?

Thanks in advance.
 
V

Vadym Stetsyak

Hello, tamarindm!

Just a hint in .NET 2.0 there is SoundPlayer class,
that can be used to play sounds and internally uses
PlaySound func


t> I need to play a .wav file over and over again. I am using the
t> following code.

t> [DllImport("winmm.dll")]
t> private static extern bool PlaySound( string lpszName, int hModule,
t> int
t> dwFlags );

t> public int SND_ASYNC = 0x0001; // play asynchronously
t> public int SND_LOOP = 0x0008; // loop the sound until next
t> PlaySound

t> PlaySound( wavfile, 0, (SND_ASYNC | SND_LOOP));

t> But it plays only once and stop. Any idea what's wrong ?

t> Thanks in advance.


--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
D

Duggi

Ummm... Thinking of hack between .Net 1.1 and .Net 2.0....

I am thinking of loading .net 2.0 assembly in .net 1.1

system.dll would be good enough.... not much sure about it....let me
try it....

Thanks
-Srinivas.
 

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

Top