Clément Pagés commited on
Commit
d566414
2 Parent(s): b20173a ef26cbc

component: allow to play multiple sources at a time

Browse files
pyannote_viewer/frontend/player/AudioPlayer.svelte CHANGED
@@ -170,12 +170,16 @@
170
  {#each [...Array(waveform.getDecodedData().numberOfChannels).keys()] as channelIdx}
171
  <label style={`height: ${waveform_settings.height}px; background-color: ${colors[channelIdx % colors.length]}`}>
172
  <input
173
- type="radio"
174
- name="channels"
175
  value={`${channelIdx}`}
176
  on:change={(ev) => {
177
- splitter.disconnect()
178
- splitter.connect(audioContext.destination, Number(ev.target.value), 0);
 
 
 
 
179
  }}
180
  />
181
  {value.labels[channelIdx]}
@@ -225,7 +229,7 @@
225
  {/if}
226
 
227
  <style>
228
- input[type="radio"] {
229
  appearance: none;
230
  background-color: #fff;
231
  margin-right: 0.5em;
@@ -237,7 +241,7 @@
237
  border-radius: 50%;
238
  }
239
 
240
- input[type="radio"]:checked {
241
  background-color: var(--color-accent);
242
  }
243
 
 
170
  {#each [...Array(waveform.getDecodedData().numberOfChannels).keys()] as channelIdx}
171
  <label style={`height: ${waveform_settings.height}px; background-color: ${colors[channelIdx % colors.length]}`}>
172
  <input
173
+ type="checkbox"
174
+ name={`${channelIdx}`}
175
  value={`${channelIdx}`}
176
  on:change={(ev) => {
177
+ const channelIdx = Number(ev.target.value);
178
+ if(Boolean(ev.target.checked)){
179
+ splitter.connect(audioContext.destination, channelIdx, 0);
180
+ } else {
181
+ splitter.disconnect(channelIdx);
182
+ }
183
  }}
184
  />
185
  {value.labels[channelIdx]}
 
229
  {/if}
230
 
231
  <style>
232
+ input[type="checkbox"] {
233
  appearance: none;
234
  background-color: #fff;
235
  margin-right: 0.5em;
 
241
  border-radius: 50%;
242
  }
243
 
244
+ input[type="checkbox"]:checked {
245
  background-color: var(--color-accent);
246
  }
247
 
pyannote_viewer/pyproject.toml CHANGED
@@ -8,7 +8,7 @@ build-backend = "hatchling.build"
8
 
9
  [project]
10
  name = "pyannote_viewer"
11
- version = "1.0.1"
12
  description = "Gradio custom component to visualize pyannote's pipelines outputs"
13
  readme = "README.md"
14
  license = "MIT"
 
8
 
9
  [project]
10
  name = "pyannote_viewer"
11
+ version = "1.0.2"
12
  description = "Gradio custom component to visualize pyannote's pipelines outputs"
13
  readme = "README.md"
14
  license = "MIT"
requirements.txt CHANGED
@@ -1,6 +1,6 @@
1
  asteroid==0.7.0
2
  fastapi==0.112.4
3
- pyannote-viewer==1.0.1
4
  pyannote-audio==3.3.2
5
  spaces==0.30.2
6
  transformers==4.46.3
 
1
  asteroid==0.7.0
2
  fastapi==0.112.4
3
+ pyannote-viewer==1.0.2
4
  pyannote-audio==3.3.2
5
  spaces==0.30.2
6
  transformers==4.46.3