caminhos de áudio nos instrumentos em projetos
Deploy / Deploy (push) Failing after 9s Details

This commit is contained in:
JotaChina 2025-05-22 17:43:16 -03:00
parent dafda1d94c
commit 7ea09b39f2
1 changed files with 17 additions and 30 deletions

View File

@ -88,9 +88,8 @@ title: "{{ page.file }}"
<!-- Instrumentos --> <!-- Instrumentos -->
{% if page.tracks and page.tracks.size > 0 %} {% if page.tracks and page.tracks.size > 0 %}
<section class="instruments-section"> <section class="instruments-section">
<h2 class="title is-5"><code>🎚️ Instrumentos</code></h2> <h2 class="title is-5"><code>🎚️ Instrumentos</h2></code>
<div class="content"> <div class="content">
<ul style="list-style: none; padding-left: 0;"> <ul style="list-style: none; padding-left: 0;">
{% for track in page.tracks %} {% for track in page.tracks %}
{% assign tem_instr = false %} {% assign tem_instr = false %}
@ -105,42 +104,30 @@ title: "{{ page.file }}"
{% endif %} {% endif %}
{% if tem_instr %} {% if tem_instr %}
<ul class="pl-4"> <ul class="pl-4">
{% for instrument in track.instruments %} {% for instrument in track.instruments %}
{% if instrument.instrument_name %} {% if instrument.instrument_name %}
<li style="margin-bottom: 0.4rem;"> <li style="margin-bottom: 0.4rem;">
<!-- Gerar link para filtro por instrumento --> <!-- Gerar link para filtro por instrumento -->
{% assign instrument_slug = instrument.instrument_name | replace: ' ', '+' %} {% assign instrument_slug = instrument.instrument_name | replace: ' ', '+' %}
<a href="{{ '/instruments/?instrument=' | append: instrument_slug | relative_url }}" class="tag is-info is-light">
<code>{{ instrument.instrument_name }}</code>
</a>
<!-- Buscar o caminho do áudio no arquivo JSON --> <a href="{{ '/instruments/?instrument=' | append: instrument_slug | relative_url }}" class="tag is-info is-light">
{% assign found_audio = false %} <code>{{ instrument.instrument_name }}</code>
</a>
{% for audio_file in site.data.src_audio_files %}
{% if audio_file contains instrument.instrument_name %} {% if instrument.audiofileprocessor and instrument.audiofileprocessor.src %}
{% assign audio_file_path = audio_file %} <!-- Exibir player de áudio para o instrumento -->
audio_file_path
{% assign found_audio = true %}
<div class="audio-player-section mt-3"> <div class="audio-player-section mt-3">
<audio controls> <audio controls>
<source src="{{ audio_file_path }}" type="audio/wav"> <source src="{{ instrument.audiofileprocessor.src | relative_url }}" type="audio/wav">
Seu navegador não suporta o elemento <code>audio</code>. Seu navegador não suporta o elemento <code>audio</code>.
</audio> </audio>
</div> </div>
{% break %}
{% endif %} {% endif %}
{% endfor %} </li>
{% if found_audio == false %}
<p>Áudio não encontrado para este instrumento.</p>
{% endif %} {% endif %}
{% endfor %}
</li> </ul>
{% endif %}
{% endfor %}
</ul>
{% endif %} {% endif %}
</li> </li>
{% endif %} {% endif %}