title: Serve files embedded in .net library to HTML in Blazor
body: <p>I am creating a <a href="https://blazor.net/" rel="nofollow noreferrer">Blazor</a> project v0.5.1 that is using a .NET Standard library to provided all of the business logic.  This library has several WAV files stored as Embedded Resources.  </p>
  
  <p>Consuming one of the resources in a typical .NET technology (WinForms, WPF, etc.) that reference this library can be done with this:</p>
  
  <pre><code>var assemName = "MyLibName";
  var assembly = AppDomain
      .CurrentDomain
      .GetAssemblies()
      .First(a =&gt; a.GetName().Name == assemName);
  
  //memory stream
  var stream = assembly.GetManifestResourceStream($"{assemName}.mysound.wav");
  
  //Can play the file at some point later
  var player = new SoundPlayer(stream)
  player.Play();
  </code></pre>
  
  <p>I would like to do the equivalent in Blazor.  Right now, I have sounds working in the app by copy/pasting the wav files into <code>wwwroot\sounds</code> folder of the project so it is served as static HTML content.  Then, in JavaScript, I can play one like this:</p>
  
  <pre><code>const audio = new Audio"\sounds\mysound.wave"]);
  audio.currentTime = 0;
  audio.play();
  </code></pre>
  
  <p>But what I would really like to do is avoid the copy-paste and somehow serve out the files dynamically as those endpoints so it is transparent to JS.</p>