Adel-Moumen
commited on
Commit
•
a4d262e
1
Parent(s):
a24bddc
Update README.md
Browse files
README.md
CHANGED
@@ -43,10 +43,15 @@ Please notice that we encourage you to read our tutorials and learn more about
|
|
43 |
```python
|
44 |
import torchaudio
|
45 |
from speechbrain.inference.encoders import MelSpectrogramEncoder
|
|
|
|
|
|
|
46 |
spk_emb_encoder = MelSpectrogramEncoder.from_hparams(source="speechbrain/spkrec-ecapa-voxceleb-mel-spec")
|
47 |
|
48 |
-
INPUT_SPEECH = "
|
49 |
-
|
|
|
|
|
50 |
spk_embedding = spk_emb_encoder.encode_waveform(ref_signal)
|
51 |
```
|
52 |
The system is trained with recordings sampled at 16kHz (single channel).
|
|
|
43 |
```python
|
44 |
import torchaudio
|
45 |
from speechbrain.inference.encoders import MelSpectrogramEncoder
|
46 |
+
from speechbrain.utils.fetching import fetch
|
47 |
+
from speechbrain.utils.data_utils import split_path
|
48 |
+
|
49 |
spk_emb_encoder = MelSpectrogramEncoder.from_hparams(source="speechbrain/spkrec-ecapa-voxceleb-mel-spec")
|
50 |
|
51 |
+
INPUT_SPEECH = "speechbrain/asr-wav2vec2-commonvoice-en/example.wav"
|
52 |
+
source, fl = split_path(INPUT_SPEECH)
|
53 |
+
path = fetch(fl, source=source, savedir="tmpdir")
|
54 |
+
ref_signal, fs_file = torchaudio.load(path)
|
55 |
spk_embedding = spk_emb_encoder.encode_waveform(ref_signal)
|
56 |
```
|
57 |
The system is trained with recordings sampled at 16kHz (single channel).
|