Questions tagged [soundplayer]

SoundPlayer is a method which plays .wav files in c#

133 questions
1
vote
1 answer

Create an array images to make movement in C#

How to create movement in C# with images? Now I am creating a snake game. Snake is made by 3 parts: head, body and tail. How to link three parts and make movement smoth? Thank you so much
1
vote
1 answer

Finish playing a sound before continuing with execution

I am trying to make my application play a quick .wav before closing the application, but every time it only plays the .wav and does not exit the application. Here is my code: bool condition = false; if (condition) { SoundPlayer sndPlayer = new…
Rage
  • 31
  • 1
  • 6
1
vote
1 answer

Stop SoundPlayer on mouseUp event

tl;dr version: How can I start playing a sound in the MouseDown event of a WinForms button and stop it from playing in the same button's MouseUp event? Intermediate C# dev here and I've been trying to write a simple Simon clone. I'm currently stuck…
Lews Therin
  • 3,707
  • 2
  • 27
  • 53
1
vote
2 answers

Is it possible to play 2 sounds back to back using SoundPlayer?

I'm looking for a way to play multiples sound back to back asynchronously. I actually have : jouerSon("_" + nbre1); jouerSon(operateur); jouerSon("_" + nbre2); jouerSon("equal"); public void jouerSon(String son) { System.Media.SoundPlayer…
Talorgoth
  • 15
  • 5
1
vote
0 answers

Do Windows 7 and Windows 8.1 handle KeyDown/SoundPlayer events differently?

I have a SoundPlayer in my form which plays under specific KeyDown conditions. On my Windows 8.1 computer, if the key is held down, the sound repetitively plays (sometimes not even finishing before it plays again) but on all the other computers I…
Kelyn Ferguson
  • 143
  • 2
  • 7
1
vote
3 answers

System.Media.SoundPlayer does not work in windows service applications

I have a simple service with the following code: on Program.Main method I have the code which is generated by vs itself(2010): static void Main() { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { …
Ali.Rashidi
  • 1,284
  • 4
  • 22
  • 51
1
vote
1 answer

Soundplayer wpf

I'm trying to play 2 songs in total, one after another. This is my code now using C# for WPF. Any advice? MediaPlayer player = new MediaPlayer(); player.Open(new Uri(@"C:\Users\L31006\Desktop\Window Wipe\welcome.mp3")); …
1
vote
1 answer

Playing embedded wav files using SoundPlayer

I have a Compact Framework 3.5 application that is responsible for scanning barcodes. There are 3 different sounds it should play depending on the situation, so I created a wrapper class around the SoundPlayer object and call the Play method on…
Brandon
  • 68,708
  • 30
  • 194
  • 223
1
vote
1 answer

asp.net SoundPlayer not playing from server

I have made the simplest test in order to check if SoundPlayer will play a wave file. From the local machine works just fine, once the site is on IIS it doesn't play the sounds (or give any error). Here is the code: using System; using…
sd_dracula
  • 3,796
  • 28
  • 87
  • 158
1
vote
1 answer

.net SoundPlayer event never firing

So I'm trying to use a soundplayer to load a wav file, and then fire an event after it's done loading it. Reason being is that I don't want my program to continue on until the WAV is fully loaded and ready to go (if there's another way to do this,…
stingray-11
  • 448
  • 2
  • 7
  • 25
1
vote
0 answers

How to control SoundPlayer WhilePlaying and AfterPlay Events?

I have Play and Stop buttons and I want to combine them into one button which works in two functions. However, I couldn't find any WhilePlaying() or AfterPlay() events. I googled some and I've found that using Thread may control events that I want.…
cihadakt
  • 3,054
  • 11
  • 37
  • 59
1
vote
1 answer

How to play multiple wav sounds at the same time in .NET CF 3.5

I am trying to make WAV Sound Player in .NET Compact Framework 3.5 for Win CE but encountered problems. I need to play two sound simultaneously but System.Media.SoundPlayer breaks the execution when the second SoundPlayer starts playing. Is there…
Patrik
  • 1,286
  • 1
  • 31
  • 64
1
vote
1 answer

SoundPool stops only once

Pressing the button the first time stops Sound. But pressing it after that does not have any effect. This is my java code: public class App extends MultiTouchActivity { SoundPool sp; int dub1s; @Override public void onCreate(Bundle…
Tom Jackson
  • 230
  • 3
  • 17
1
vote
3 answers

SoundPlayer and playing a seamless succession of sounds

What I'm trying to do is play a looping wav, but with a specific loop start position like the samples used in music module files (.it, s3m. .mod, etc.). SoundPlayer doesn't have this feature, so I created two separate files: the original wav and the…
kreddkrikk
  • 389
  • 3
  • 12
1
vote
2 answers

How to play all words using narrator?

my project is text to speech project, here is my code, string amma = myacess.Text; // string[] words = Regex.Split(amma,"*"); char[] delimeter = new char[] { '*' }; string[] words = amma.Split(delimeter, StringSplitOptions.RemoveEmptyEntries); for(…
1 2 3
8 9