title: How can I pass a string variable through the soundplayer?
body: <p>I'm trying to pass the file location from my list box into my sound player.</p>
  <pre><code>string fileLocation = listBox1.ToString();
  SoundPlayer splayer = new SoundPlayer(soundLocation: fileLocation);
  splayer.Play();
  </code></pre>
  <p>debugging shows the variable coming through as &quot;C:\Temp\Sample1.wav&quot;.</p>
  <p>The error comes back as &quot;System.NotSupportedException: 'The given path's format is not supported.'&quot;</p>
  <p>Can anyone tell me what I'm doing wrong here?</p>