Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Sounds in C#

Name: Anonymous 2009-02-14 4:34

I'm trying to figure out how to use the SoundPlayer Class in C# to play a .wav file as music for the title screen of an application.  Can anyone tell me what's the best way to do this?

Name: Anonymous 2009-02-14 4:40

Name: Anonymous 2009-02-14 4:50

http://msdn.microsoft.com/en-us/library/system.media.soundplayer.aspx

One of the best parts of C# is the shit loads of easy to access documentation.

Name: Anonymous 2009-02-14 4:54

>>3
Except MSDN fucking sucks.

Name: Anonymous 2009-02-14 5:48

>>3
shit loads of easy to access documentation
Kind of true. But it's got a lot of flaws.

The examples are often overly verbose to the point of obscuring what it is they're actually trying to show, posted in VB, C#, C++, and every other language they can think of (and the language filter cookie seems to reset randomly).

There's a lot of broken links (perhaps not in the C# section though), and the link structure seems to change quite a lot.

It has documentation pages for every property of every class, most of which are completely useless and not worth clicking.

Name: Anonymous 2009-02-14 5:59

>>5
READING IS HARD!

Name: Anonymous 2009-02-14 6:04

>>4
Someone cannot read extensive and useful documentation, instead they waste /prog/'s time.

Name: Anonymous 2009-02-14 8:00

>>4
I don't even program for Windows, but I love reading MSDN. Some of my favorite docs, right up there with the Hyperspec.

Name: Anonymous 2009-02-14 10:00

>>3
This. Also, Intellisense and clicking on a class name + F1.

Name: Anonymous 2009-02-14 15:07

>>6
Programming ishard, let's go <shopping>!

Name: Anonymous 2009-02-14 15:45

>>10
Shopping is hard, let's?LOGIC ERROR

Name: Anonymous 2009-02-14 16:23

>>11
Shopping is what women do.
It can't be hard...

Name: Anonymous 2009-02-14 16:27

>>12
Womenmakemehard.

Name: Anonymous 2009-02-14 19:14

Real programmers don't need to read documentation. They just know how frameworks work.

It is fucking sad there is through and complete documentation, and tutorials, and videos and articles etc. from the people who actually created the shit and professional educators availble for free all organized and easy to find.

Name: Anonymous 2009-02-14 19:17

>>14
Real programmers do more than "HELLO WORLD".

Oh wait, IHBT.

Name: Anonymous 2009-02-14 20:28

All you need to do is create a new instance of SoundPlayer, add a handler for the LoadCompleted event, set the SoundLocation property to the location of your WAV file, load the sound in and then using your event handler set the sound to play asynchronously using the Play method.

Name: Anonymous 2009-02-14 22:52

>>13
Menmakemeunbelievablyhorny.

Name: OP 2009-02-15 4:15

I've long since figured out how to use it, but if I try to run more than one sound at a time, the one I have looping stops and the other one runs.  I tried running it as a background worker but the same thing.  Is there a better way to work with multiple sounds running in your application at once?

Name: Anonymous 2009-02-15 4:30

>>18
Try using LearningToProgram;

Name: Anonymous 2009-02-15 5:29

using Mit.Sicp;

Name: Anonymous 2009-02-17 20:38

using Mit.Tens;

Name: Anonymous 2009-03-06 11:08

This regex itself is   generally fine SYntactically.

Name: Trollbot9000 2009-07-01 8:42


The language dynamic extensibility.

Name: Anonymous 2011-02-04 17:38

Don't change these.
Name: Email:
Entire Thread Thread List