Click here to Skip to main content
15,905,508 members
Home / Discussions / C#
   

C#

 
GeneralRe: Source safe slow pulling files - NAnt Get Pin
glocklt423-Nov-05 7:49
glocklt423-Nov-05 7:49 
QuestionProblem with Paint Pin
naglbitur23-Nov-05 6:48
naglbitur23-Nov-05 6:48 
AnswerRe: Problem with Paint Pin
Stanciu Vlad23-Nov-05 6:57
Stanciu Vlad23-Nov-05 6:57 
QuestionListview drag drop and Ghost icon issue Pin
sameerhanda23-Nov-05 4:09
sameerhanda23-Nov-05 4:09 
AnswerRe: Listview drag drop and Ghost icon issue Pin
Curtis Schlak.23-Nov-05 12:12
Curtis Schlak.23-Nov-05 12:12 
QuestionPlease help with problem – multiple audio file playback(c#) Pin
truly_pringled23-Nov-05 4:03
truly_pringled23-Nov-05 4:03 
GeneralRe: Please help with problem – multiple audio file playback(c#) Pin
mav.northwind23-Nov-05 4:25
mav.northwind23-Nov-05 4:25 
QuestionRe: Please help with problem – multiple audio file playback(c#) Pin
truly_pringled23-Nov-05 5:32
truly_pringled23-Nov-05 5:32 
Thanks for your reply

I am using .net 1.1

The bits of code I have been using are shown below:-

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Threading;
using System.Runtime.InteropServices;

private string currentSoundFileName;

[DllImport("winmm.dll")] //load the sound libary
public static extern long PlaySound(String lpszName, long hModule, long dwFlags);
private Thread soundThread = null;


public void PlaySoundInThread(string wavefile)
{
currentSoundFileName = wavefile;
soundThread = new Thread(new ThreadStart(PlayASound));
soundThread.Start();
}


public void PlayASound()
{
if (currentSoundFileName.Length > 0)
{
PlaySound(Application.StartupPath + "\\" +currentSoundFileName, 0, 0);
}
currentSoundFileName = "";
soundThread.Abort();
}


Then I use the line below to play a wave file (i have stored the wav file in the debug directory)

PlaySoundInThread("1.wav");

This works with one wav file but when I have tried to play another wave file after this, I just replete the line of code with a different wav file entered, and that's where my problem is, it does not work.

Thanks

RoB
AnswerRe: Please help with problem – multiple audio file playback(c#) Pin
Dave Kreskowiak23-Nov-05 5:44
mveDave Kreskowiak23-Nov-05 5:44 
AnswerRe: Please help with problem – multiple audio file playback(c#) Pin
truly_pringled24-Nov-05 3:48
truly_pringled24-Nov-05 3:48 
QuestionSystem.Resources.MissingManifestResourceException Pin
Dan Neely23-Nov-05 3:50
Dan Neely23-Nov-05 3:50 
AnswerRe: System.Resources.MissingManifestResourceException Pin
Dan Neely23-Nov-05 5:32
Dan Neely23-Nov-05 5:32 
QuestionConditional Installation of merge module? Pin
mav.northwind23-Nov-05 3:38
mav.northwind23-Nov-05 3:38 
Questionuser interface standards Pin
rmedo23-Nov-05 3:03
rmedo23-Nov-05 3:03 
AnswerRe: user interface standards Pin
Dan Neely23-Nov-05 4:23
Dan Neely23-Nov-05 4:23 
AnswerRe: user interface standards Pin
Not Active23-Nov-05 5:54
mentorNot Active23-Nov-05 5:54 
QuestionUI control hot key (Alt+?) Pin
smurfy3423-Nov-05 2:56
smurfy3423-Nov-05 2:56 
AnswerRe: UI control hot key (Alt+?) Pin
Dan Neely23-Nov-05 3:56
Dan Neely23-Nov-05 3:56 
GeneralRe: UI control hot key (Alt+?) Pin
smurfy3423-Nov-05 4:16
smurfy3423-Nov-05 4:16 
AnswerRe: UI control hot key (Alt+?) Pin
Dr. Spack23-Nov-05 9:40
Dr. Spack23-Nov-05 9:40 
GeneralRe: UI control hot key (Alt+?) Pin
Dr. Spack23-Nov-05 9:45
Dr. Spack23-Nov-05 9:45 
QuestionXML WYSIWYG Pin
Gktony23-Nov-05 1:33
Gktony23-Nov-05 1:33 
Questionvb to C#.Net Pin
Ankit Aneja23-Nov-05 0:45
Ankit Aneja23-Nov-05 0:45 
AnswerRe: vb to C#.Net Pin
User 665823-Nov-05 1:41
User 665823-Nov-05 1:41 
GeneralRe: vb to C#.Net Pin
Ankit Aneja23-Nov-05 1:52
Ankit Aneja23-Nov-05 1:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.