Add audiowidget endpoint: Blueprint renders audiowidget.tmpl, PaneCP fetches it on synthesis completion
This commit is contained in:
18
templates/vue3_neusik/audiowidget.tmpl.stub
Normal file
18
templates/vue3_neusik/audiowidget.tmpl.stub
Normal file
@@ -0,0 +1,18 @@
|
||||
{# audiowidget.tmpl.stub — copy to audiowidget.tmpl in the same directory to activate.
|
||||
Customise to match your site's look and feel.
|
||||
|
||||
Context variables (passed as query params by the score editor):
|
||||
result_url – URL of the rendered MP3, or empty string
|
||||
errors – synthesis error message, or empty string
|
||||
#}
|
||||
{% if errors %}
|
||||
<div class="se-error">{{ errors }}</div>
|
||||
{% elif result_url %}
|
||||
<figure class="audio-result">
|
||||
<figcaption>Rendered result</figcaption>
|
||||
<audio controls preload="metadata" style="display:block;width:100%">
|
||||
<source src="{{ result_url }}" type="audio/mpeg">
|
||||
<a href="{{ result_url }}">Download MP3</a>
|
||||
</audio>
|
||||
</figure>
|
||||
{% endif %}
|
||||
@@ -14,8 +14,9 @@ window.NEUSICIAN_URLS = {
|
||||
astlog: "{{ url_for('astlog') }}",
|
||||
score: "{{ url_for('score') }}",
|
||||
status: "{{ url_for('statusjson') }}",
|
||||
result: "{{ url_for('send_audio_generated') }}",
|
||||
submit: "{{ url_for('public-yaml-acceptor') }}"
|
||||
result: "{{ url_for('send_audio_generated') }}",
|
||||
submit: "{{ url_for('public-yaml-acceptor') }}",
|
||||
audiowidget: "{{ url_for('vue3_neusik.audiowidget') }}"
|
||||
};
|
||||
</script>
|
||||
<script type="importmap">
|
||||
|
||||
Reference in New Issue
Block a user