Update README.md
Browse files
README.md
CHANGED
|
@@ -13,7 +13,7 @@ It's main use case is providing a low footprint decoder for on-device TTS.
|
|
| 13 |
```python
|
| 14 |
import librosa
|
| 15 |
import torch
|
| 16 |
-
import
|
| 17 |
from torchaudio import transforms as T
|
| 18 |
from neucodec import NeuCodec, NeuCodecOnnxDecoder
|
| 19 |
|
|
@@ -29,7 +29,7 @@ with torch.no_grad():
|
|
| 29 |
fsq_codes = model.encode_code(y)
|
| 30 |
# fsq_codes = model.encode_code(librosa.ex("libri1")) # or directly pass your filepath!
|
| 31 |
print(f"Codes shape: {fsq_codes.shape}")
|
| 32 |
-
recon = compiled_model.decode_code(fsq_codes)
|
| 33 |
|
| 34 |
-
|
| 35 |
```
|
|
|
|
| 13 |
```python
|
| 14 |
import librosa
|
| 15 |
import torch
|
| 16 |
+
import soundfile as sf
|
| 17 |
from torchaudio import transforms as T
|
| 18 |
from neucodec import NeuCodec, NeuCodecOnnxDecoder
|
| 19 |
|
|
|
|
| 29 |
fsq_codes = model.encode_code(y)
|
| 30 |
# fsq_codes = model.encode_code(librosa.ex("libri1")) # or directly pass your filepath!
|
| 31 |
print(f"Codes shape: {fsq_codes.shape}")
|
| 32 |
+
recon = compiled_model.decode_code(fsq_codes) # (B, 1, T_24)
|
| 33 |
|
| 34 |
+
sf.write("reconstructed.wav", recon, 24_000)
|
| 35 |
```
|