Questions tagged [soundplayer]

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

133 questions
0
votes
2 answers

Is there any way i can somehow have two sounds play at once in c# console app?

Im working on a text game in c#. But i wanted to have multiple sounds at once. So i tried to use SoundPlayer. But whenever i loaded up another sound, it just cut off the other one. If that makes sense. Im new to programming, so please try to explain…
0
votes
1 answer

C# SoundPlayer not working properly when put after Console.ReadLine()

I have a very simple console application where I'm trying to play a wav file with SoundPlayer. static void Main(string[] args) { SoundPlayer sp = new SoundPlayer("path/to/sound.wav"); while(true){ Console.ReadLine(); …
Simon M.
  • 11
  • 3
0
votes
1 answer

Trying to show ad when sound played 10 times, ad doesn't show & no sound after 5th time played

I'm trying to show ad When user presses on sound card 10 times but when I press on sound card 10th time no ad is shown and no sound plays anymore until I press stop button after which sound plays again until I press it 10 times again Part of my main…
ekor
  • 81
  • 1
  • 7
0
votes
1 answer

How to add sound in sound player from resource WPF

How can i add this sound image like i make it with background in xaml. I already have tried this…
0
votes
2 answers

C# SoundPlayer - should be static or instance based?

I am using SoundPlayer class in C# (WPF), to play the same .5s audio over and over (on key press). Every time user presses custom on-screen keyboard buttons, sound plays. static SoundPlayer soundPlayer = null; try { soundPlayer = new…
OverMars
  • 1,077
  • 3
  • 16
  • 33
0
votes
0 answers

Embed/Play sound from web page (Like Amazons Digital music samples)

I'm creating a tool to scrape and search the Amazon music database, it then cross references with google to display a bunch of information about the songs. One thing I want to add if possible, is to play the sound from the form using the media link…
user3717174
  • 111
  • 9
0
votes
1 answer

Can't play SoundPlayer on server

I am doing website on C# ASP. My task is play a sound file on web. When i did it on my computer (IIS), it was working but when i up my source to server side it's not working, not any fail, it's still complete code but no sound! I wrote code on…
0
votes
1 answer

pause sound on mouse click

I'm trying to design my own audio player. I made "play", "pause" and "stop" symbols (Png format) and I couldn't find a solution to actually ad play pause and stop functions when you click on them. I figured out how to play sound when the word…
0
votes
1 answer

SoundPlayer on Visual Studio 2017 Mac outputs no sound

I have instantiated a System.Media.SoundPlayer and I am (trying to) use it to play a .wav file. However, as you may have picked up from the title of this, it isn't working (no sound is being outputted). I am using C# and creating a Console…
0
votes
0 answers

JMF Audio Player

I was creating a Audio Player in Java using JMF API but i am stucked in creating volume controls (setMute() is throwing Exception) and integrating them with JSlider. Heres the code for Mute Functionality: public void volume() { if(ismute) …
Piyush Pant
  • 35
  • 1
  • 6
0
votes
1 answer

SoundPlayer.PlaySync stopping prematurely

I want to play a wav file synchronously on the gui thread, but my call to PlaySync is returning early (and prematurely stopping playback). The wav file is 2-3 minutes. Here's what my code looks like: //in gui code (event handler) …
JeffE
  • 794
  • 2
  • 9
  • 15
0
votes
1 answer

Do ... While System.Media.SoundPlayer() is in use

I have been trying to display text on my Console Application while a sound file is currently playing, lyrics as an example. How is the best way to do it? struct Music { public void PlaySong() { …
0
votes
1 answer

How to Add a .wav File to a Clickable Button?

I'm using Visual Studio 2017; and, I'm fairly new to coding. I'm trying to add a .wav audio file to a Clickable Button in my program. I first created a "Resource.resx" file and added the audio resource, with the changed 'properties' to "Embedded in…
jaxdavio
  • 19
  • 5
0
votes
0 answers

issue with playing .wav-file in C#

i'm working on a project in which sounds (.wav-files) should be played when some actions happen. The files are on the local drive in a subfolder of the project/location. For playing the sounds synchronously one after another I have the following…
0
votes
0 answers

SoundPlayer.Stop() hangs, buzzes

I play sound via SoundPlayer and stop it when a button is clicked. Parallel some timers are running in the background. On some computers the sound hangs (not the application, sort of buzzing), when stop is clicked. On some it works as excepted. …
daniel
  • 34,281
  • 39
  • 104
  • 158
1 2 3
8 9