SoundPlayer is a method which plays .wav files in c#
Questions tagged [soundplayer]
133 questions
1
vote
3 answers
How to append sounds in C#
I am studying C# by myself by reading some books and watching some tutorials. So, i decided to make a small project at the same time, to get more experience and harden my knowledge. I am trying to create a text to speech program in Georgian(my…

vato
- 141
- 2
- 11
1
vote
2 answers
C# SoundPlayer static after WAV plays
I'm using this code to play a WAV file from a resource, and the audio plays correctly, but then I get a short blast of static after it plays (about 1/2 second):
//System.Media.SystemSounds.Beep.Play();
SoundPlayer sndPlayer = new…

eselk
- 6,764
- 7
- 60
- 93
0
votes
2 answers
Play custom formats with C# SoundPlayer class
By default, it can play just .wav. Is there a way to make it play other format?

el ninho
- 4,183
- 15
- 56
- 77
0
votes
2 answers
Threading issue when playing music file
What I'm trying to do is play a music file for a specified duration, and then stop playing. However, the whole music file is being played. I cannot use the 'PlaySync()' method as I cannot have the thread being blocked.

Dot NET
- 4,891
- 13
- 55
- 98
0
votes
6 answers
How to play all music files stored in ArrayList
I've got an ArrayList which contains a number of sound files as elements. A foreach loop iterates this collection, and plays each note.
The problem is that when the program is run, only the last note plays, but when debugging, it goes through all…

Dot NET
- 4,891
- 13
- 55
- 98
0
votes
1 answer
C#, SoundPlayer cannot find my wav file to play it
A simple program, where a random note is being chosen, shown and played. It supposed to use random number that will be used as an address in the name and file location arrays. But the program gives an error - "make sure the file is here". It is. Is…

Kaman
- 1
0
votes
0 answers
SoundPlayer.Play makes no sound in a Visual Studio debugger thread
I am trying to play a sound (wav file) in a thread in a test method in Visual Studio. The code below in the test method tries to play the sound file three times. The first play works fine and demonstrates the code that is in the PlaySound method.…

Kevin
- 1,548
- 2
- 19
- 34
0
votes
2 answers
Controlling Sounds in audio in multiple forms
I want to play a playlist in the resources folder for a windows forms project I'm working on (wav or mp3). The application will be completely offline. (actually a game project)
What I want to do is this:
I need to be able to stop or convert a music…

syozkn
- 3
- 3
0
votes
0 answers
How do I use powershell to play WAV file from TMP directory with System.Media.Soundplayer?
I have a file called f.wav in my temp folder.
I am trying to use powershell's System.Media.SoundPlayer to play the wave file from within powershell.
$PlayWav=New-Object…

I am Jakoby
- 577
- 4
- 19
0
votes
4 answers
Audio file path not dynamic
I need the audio file to played when the app runs and it does this successfully, the only problem is is when I move the application to a different PC, the sound won't work because the file path doesn't return true any more. How do I fix…

Luke Warren
- 25
- 4
0
votes
1 answer
The end of an audio file that's looping?
I'm trying to create a simple audio Looper to record my own songs. For those of you who don't know what an audio Looper is, you first record a layer of a song(let's say a piece of piano) then you start Looping that piece to add a piece of guitar on…

Baevern
- 1
- 1
0
votes
1 answer
System.Media.SoundPlayer throws FileNotFoundException in .Net
trying to play a .wav file in my application for a preview.
-> following code is beeing executed:
System.Media.SoundPlayer player = new System.Media.SoundPlayer();
player.SoundLocation = this.UnderlyingAudioFile.FullName;
player.Play();
Error…

julian bechtold
- 1,875
- 2
- 19
- 49
0
votes
1 answer
How to play Multiple sound files from the properties using Sound Player
i am making a quiz and in each form i have background music and if they get an answer correct i want to play a sound effect. When i do this is stops the background music and plays the sound effect then no sound is playing, does anyone know how do…

RyanJM
- 19
- 5
0
votes
1 answer
SoundPlayer not working when visual studio application is published
When I run in Microsoft Visual Studio, the sound works. However, after I published it, the sound doenst work. The sound properties are set to Content. Can someone help? Thanks
private void InitializeSound()
{
// Create an…

Sophie Chai
- 27
- 4
0
votes
0 answers
White noise appears in the sound player when I try to open a second form in C # WinForms
I have a part in my WinForms program that opens a second form with animation in a PictureBox and starts playing music through SoundPlayer. The problem is that after 0.5 seconds from the start of music playback, a loud white noise appears, music is…

V1PEX7
- 1