clement-pages commited on
Commit
897bf63
·
1 Parent(s): 41d995e

fix no sound issue in monochannel case

Browse files
pyannote_viewer/frontend/Index.svelte CHANGED
@@ -106,7 +106,6 @@
106
  minPxPerSec: 20,
107
  mediaControls: waveform_options.show_controls,
108
  sampleRate: waveform_options.sample_rate || 44100,
109
- splitChannels: true,
110
  };
111
 
112
 
 
106
  minPxPerSec: 20,
107
  mediaControls: waveform_options.show_controls,
108
  sampleRate: waveform_options.sample_rate || 44100,
 
109
  };
110
 
111
 
pyannote_viewer/frontend/player/AudioPlayer.svelte CHANGED
@@ -58,6 +58,7 @@
58
  waveform = WaveSurfer.create({
59
  container: container,
60
  media: audio,
 
61
  ...waveform_settings
62
  });
63
  };
@@ -81,6 +82,10 @@
81
  splitter = audioContext.createChannelSplitter(numChannels);
82
  mediaNode.connect(splitter);
83
 
 
 
 
 
84
  // add diarization annotation on each source:
85
  if(!wsRegion){
86
  wsRegion = waveform.registerPlugin(RegionsPlugin.create())
 
58
  waveform = WaveSurfer.create({
59
  container: container,
60
  media: audio,
61
+ splitChannels: value.multichannel,
62
  ...waveform_settings
63
  });
64
  };
 
82
  splitter = audioContext.createChannelSplitter(numChannels);
83
  mediaNode.connect(splitter);
84
 
85
+ if(!value.multichannel){
86
+ splitter.connect(audioContext.destination, 0);
87
+ }
88
+
89
  // add diarization annotation on each source:
90
  if(!wsRegion){
91
  wsRegion = waveform.registerPlugin(RegionsPlugin.create())