There probably isn't a specific directive for embedding audio files in the html
output, but is it possible to at least embed an html
code that does this, such as:
<audio controls="controls">
<source src="foo.wav" type="audio/wav">
Your browser does not support the <code>audio</code> element.
</audio>
And, if yes, how?
Update:
OK, I managed to solve this, simply adding this to the .rst
document:
.. raw:: html
<audio controls="controls">
<source src="_static/foo.wav" type="audio/wav">
Your browser does not support the <code>audio</code> element.
</audio>
But, I had to manually copy the foo.wav
file into _build/html/_static
. This isn't that bad, but I was wondering whether this can be done automatically and if I can keep the audio files, say in, audio
directory inside the docs
root dir...?!?
Use the raw
directive.
.. raw:: html
<audio controls="controls">
<source src="foo.wav" type="audio/wav">
Your browser does not support the <code>audio</code> element.
</audio>