473,890 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sndPlaySound function problem

i want to play a .wav file using sndPlaySound and PlaySound function
but both function doesn't works in the expected way... i just hear a
click sound after execution of these functions.... not the original
recorded sound of .wav file.... on the other hand when i make use of
wave functions to play sound it works fine... can anybody tell that
what exactly the problem is??? all docs i read suggests that these
functions works fine if we hav eto play only a single wave file... but
this doesn't works in my case.... help me...

May 22 '06 #1
2 2558
Try this: (My testBox1.Text is a wav file name with the path)

System.Media.So undPlayer player = new
System.Media.So undPlayer(textB ox1.Text);

player.Play();

"Ansh" <sh************ @gmail.com> a écrit dans le message de news:
11************* *********@y43g2 00...legr oups.com...
i want to play a .wav file using sndPlaySound and PlaySound function
but both function doesn't works in the expected way... i just hear a
click sound after execution of these functions.... not the original
recorded sound of .wav file.... on the other hand when i make use of
wave functions to play sound it works fine... can anybody tell that
what exactly the problem is??? all docs i read suggests that these
functions works fine if we hav eto play only a single wave file... but
this doesn't works in my case.... help me...

May 22 '06 #2
Found some interesting references here:
http://www.pinvoke.net/default.aspx/...PlaySound.html
Have fun :-)

"Ansh" <sh************ @gmail.com> a écrit dans le message de news:
11************* *********@y43g2 00...legr oups.com...
i want to play a .wav file using sndPlaySound and PlaySound function
but both function doesn't works in the expected way... i just hear a
click sound after execution of these functions.... not the original
recorded sound of .wav file.... on the other hand when i make use of
wave functions to play sound it works fine... can anybody tell that
what exactly the problem is??? all docs i read suggests that these
functions works fine if we hav eto play only a single wave file... but
this doesn't works in my case.... help me...

May 22 '06 #3

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

Similar topics

2
2343
by: Hennie de Nooijer | last post by:
Because of an error in google or underlying site i can reply on my own issue. Therefore i copied the former entered message in this message. -------------------------------------REPY---------------------------------- Hi Maybe i wasn't clear. I want to dynamically check whether what the lowest date and the highest date is in the calendar table. The presented solutions has fixed dates and i don't want that. If i could store a global...
7
5202
by: Mike D. | last post by:
I have a problem with a dynamic library I am developing, but it is really more of a pointer issue than anything else. Hopefully someone here can lend me some assistance or insight into resolving this. Ok... here goes.... I have a function that passes a pointer to a string to another function. For example: int FunctionA ()
19
2116
by: Nak | last post by:
Hi there, *fingers crossed that the newsserver works long enough for me to see any replies to this!!* I'm having crashes when using SndPlaySound with SND_ASYNC and SND_MEMORY in VB.NET. The sounds are being loaded from embedded resources and stored into byte arrays, which are then being stored in a hashtable for easy retrieval second time around. Occasionally a get a funny "beep" sound and the application crashes, the report tells...
9
11861
by: Andy | last post by:
Hi, I have an application that has several forms. Each form acts as a monitor of a gateway system. If the gateway appears to be dead, the application should play a .wav file (not resource) until the user clicks a button to acknowledge the situation. To keep things simple, lets assume there is only one monitor. If I use the old sndPlaySound function, with the code:
2
2539
by: Fernando Barsoba | last post by:
Dear all, I have been posting about a problem trying to encrypt certain data using HMAC-SHA1 functions. I posted that my problem was solved, but unfortunately, I was being overly optimistic. I am really desperate now, because I havent' been able to locate the origin of the problem for a couple of days now.. PROBLEM: the message digest obtained differs each time I execute the code, but works perfectly when applying the "control", that...
78
5002
by: Josiah Manson | last post by:
I found that I was repeating the same couple of lines over and over in a function and decided to split those lines into a nested function after copying one too many minor changes all over. The only problem is that my little helper function doesn't work! It claims that a variable doesn't exist. If I move the variable declaration, it finds the variable, but can't change it. Declaring the variable global in the nested function doesn't work...
6
5943
by: RandomElle | last post by:
Hi there I'm hoping someone can help me out with the use of the Eval function. I am using Access2003 under WinXP Pro. I can successfully use the Eval function and get it to call any function with or without parms. I know that any function that is passed to Eval() must be declared Public. It can be a Sub or Function, as long as it's Public. I even have it where the "function" evaluated by Eval can be in a form (class) module or in a standard...
2
7417
by: Ravikiranreddy | last post by:
Hi every one, Am pasting the error code returned in log please help me in fixing it--- ERROR:An error occurred during the execution of the command "/opt/IBM/db2/V8.1/instance/dascrt -u dasusr1 -d". The DB2 Administration Server may not function properly. The return value is "1". ERROR:## call function cleanup_reg_list das crt dasusr1 ## call function create_das
6
4558
by: pauldepstein | last post by:
Let double NR( double x, double(*)(const double&) f ) be the signature of a Newton-Raphson function NR. Here, f is a function which returns a double and accepts a const double&. The aim of the game is to find a zero of this function f (the point at which f crosses the x-axis). This zero-of-f which solves our problem is the double which NR returns. It remains to explain what the "double x" represents. This is the...
0
9975
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9812
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11212
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10799
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10446
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7154
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6032
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4655
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.