title: R Shiny - Audio Playback
body: <p>For this question, I'm using</p>
  
  <pre><code>library("shiny")
  library("tuneR")
  library("markdown")
  </code></pre>
  
  <p>though I'm sure only shiny is relevant.</p>
  
  <p>Per the Shiny <a href="http://shiny.rstudio.com/articles/tag-glossary.html" rel="noreferrer">tag glossary</a>, I should be able to use</p>
  
  <pre><code>tags$audio(src = "wavs/tempwav.wav", type = "audio/wav", autoplay = NA, controls = NA)
  </code></pre>
  
  <p>which generates the html</p>
  
  <pre><code>&lt;audio src="wavs/tempwav.wav" type="audio/wav" autoplay controls&gt;&lt;/audio&gt; 
  </code></pre>
  
  <p>to play a sound in a Shiny server. </p>
  
  <p>I can't get this to work with any kind of mp3, wav, or other file. Edge gives a, "this type of audio file is not supported" error, while the RStudio webpage and Chrome just show a blank playback control. I want it to work with *.wav files generated on the fly by the Shiny program. The wav files are generated correctly and play correctly in every music player I tried (eg, VLC, WMP, MMgold, WinAmp, etc).</p>
  
  <p>Using the code in an HTML file, eg</p>
  
  <pre><code>&lt;HTML&gt;
  &lt;audio src="wavs/tempwav.wav" type="audio/wav" autoplay controls&gt;&lt;/audio&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>works just fine in any browser. I think the issue may have to do with how R Shiny deals with directories. Suggestions?</p>