1

I am playing wav files as user prompts in dotnet. My code works fine on a laptop, but seems to skip sounds on a netbook. How do I ensure wav playback is consistent on the netbook in dotnet? Current code that causes occasional playback problems in netbook:

using (var player = new SoundPlayer(pSoundPath))
{
  player.Play();
}

Same issue when I pre-load the sounds into a dictionary to call by sound name:

Dictionary<string, SoundPlayer> playerDict = new Dictionary<string, SoundPlayer>();
playerDict.Add(soundName, new SoundPlayer(soundPath));
playerDict[soundname].LoadAsync();
moca
  • 656
  • 5
  • 3

1 Answers1

0

Perhaps giving a dedicated higher-priority thread to the Player may help. Async != parallel. It could be that the async call is contending for processor time with your foreground work.

Ryan Bennett
  • 3,404
  • 19
  • 32