C#C
C#10mo ago
mustaf

why does the audio stop playing even on a seprate thread

Thread task = new Thread(() =>
{
shat(); //runs an audio file using Naudio
});
task.Start();
// Task task = new Task(() =>
//{


for (int i = 0; i < 500; i++)
{
Random Rnd = new Random();
double num = Rnd.Next(100);
updateprogressbar1(num);
int j = i / 5;
updateProgressbar2(j);
Thread.Sleep(10);
}


when i try to run this the audio plays for a split second but then cuts off , then plays again after the loop is complete
Was this page helpful?