SoundPlayer is a method which plays .wav files in c#
Questions tagged [soundplayer]
133 questions
0
votes
0 answers
Diposal of SoundPlayer and Resource in C#
I am working on a kind of (at least closely related) Virtual Keyboard and want to include some clicking Sound. For testing I have just used
SoundPlayer player = new SoundPlayer(Resource2.click);
player .PlaySync();
Now I obviously do not want…

Zorakh
- 1
- 3
0
votes
1 answer
QSound Unexpected null receiver while playing .wav files
I would like to play .wav samples of engine through out Qt creator. Of course the very first thought was on QSound class, but I did whatever was necessary to play it and it always shows me
QCoreApplication::postEvent: Unexpected null…
user5727626
0
votes
2 answers
Playing music from collection with SoundPlayer
So I am doing a simple piano and trying to traverse the collection where I stored the notes, but the SoundPlayer doesn't want to play them properly in "without debugging mode", playing only the last one. However when I put a breakpoint there it…

Gleb Eliseev
- 65
- 11
0
votes
1 answer
Soundplayer for compiled application
How can I hardcode the code in order to pull the .wav file from the project?
As well as where should I put the .wav file?
The code I am currently using is:
private void timer2_Tick(object sender, EventArgs e)
{
SoundPlayer…

Kyle Rickaby
- 117
- 4
- 15
0
votes
1 answer
Playing a .wav file in c# using SoundPlayer
I am currently having a probelm, where a file was sent to me as .m4a and I renamed it to .wav..... (I think that is the issue as I can play other .wav files)
Now it is giving me this error when I run the code:
Additional information: The file…

Kyle Rickaby
- 117
- 4
- 15
0
votes
2 answers
Issue with SoundPlayer
Situation
this is probably a really simple question with a really simple answer, but I can't find the answer anywhere, so I'm going to ask here, I've been working around this because it isn't a huge issue for me, but it will be when I submit my…

Method
- 143
- 9
0
votes
3 answers
Stopping a SoundPlayer loop at the local level
I'm working on setting up an alarm that pops up as a dialog with multiple sound file options the user can choose from. The problem I'm having is creating a sound player at the local level that I can close with a button. The problem I'm having is…

EvanRyan
- 189
- 6
- 14
0
votes
3 answers
send array of bytes to System.Media.SoundPlayer in c#
I want send string byte to speaker something like this:
byte[] bt = {12,32,43,74,23,53,24,54,234,253,153};// example array
var ms = new MemoryStream(bt);
var sound = new System.Media.SoundPlayer();
sound.Stream = ms;
sound.Play();
but I get this…

m-tech
- 338
- 2
- 14
0
votes
1 answer
System.Media.SoundPlayer only plays through one speaker
I have a sound I am playing through System.Media.SoundPlayer in C#. When I play it within visual studio it plays fine through both speakers. However, when I play it using System.Media.SoundPlayer, it only plays through the left speaker. I am using…

codythecoder
- 376
- 5
- 17
0
votes
1 answer
Array of sounds in c#
I am trying to make a program that will show images like a slide show, and each time a picture is shown a sound will play for the current image, a different one for each image.
How I can use an array with sounds and play the sound from the…

user3605083
- 3
- 2
0
votes
2 answers
Android mediaplayer stop sound when another item is clicked
I'm building a list view soundboard and I need a code for play a sound when I click on a item and stop it when another is clicked, then start the new sound. I have tried many code but the app crashes.

user3437592
- 59
- 3
- 9
0
votes
2 answers
Soundplayer issue? boolean statement should execute a sound
I've ran into a bit of an issue I can't seem to resolve, the test for if KeyPressed == false does play the 'car_still.wav', however the test for if KeyPressed == true doesn't play anything at all.
How do I go about fixing the issue mentioned above…

Szymon Zmudzki
- 89
- 1
- 8
0
votes
1 answer
Play sound in both speaker and headset wpf
I have an wpf application and i am using the soundPlayer class to play sound (for eg ringtone). Currently the tone plays either on speakers or on the headset (if its plugged in).
I would like the application to play the tone on speaker even when the…

user2054702
- 69
- 1
- 11
0
votes
1 answer
C# SoundPlayer stops playing wav file before end
I created a .wav file which helds exactly a complete sine wave. You can verify by open it with Audacity or similar.
https://mega.co.nz/#!DkR3gKia!dV9zDtdzmqHDDkEUeZviYf78SDkkxWVjUTy8kYEJnio
I want to play this file using the C# .Net SoundPlayer.…

user2799180
- 719
- 1
- 11
- 29
0
votes
1 answer
Soundplayer refusing to replay after stopping it once
I've created a sound player to play a certian sound out of a collection of sounds at any given time. One of the sounds in the collect needs to be played in a looping manner. Below is my code:
public class SoundService : ISoundService
{
…

Eric
- 419
- 4
- 9