Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasnewman committed Sep 30, 2024
1 parent 004976c commit bc78eff
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,27 @@ pip install vocos-mlx
```python
from vocos_mlx import Vocos, load_audio, log_mel_spectrogram

audio = load_audio("audio.wav", 24_000)
mel_spec = log_mel_spectrogram(audio, n_mels = 100)

vocos = Vocos.from_pretrained("lucasnewman/vocos-mel-24khz")

# reconstruct
audio = load_audio("audio.wav", 24_000)
reconstructed_audio = vocos(audio)

# decode from mel spec
decoded_audio = vocos.decode(mx.expand_dims(mel_spec, axis=0))
mel_spec = log_mel_spectrogram(audio, n_mels = 100)
decoded_audio = vocos.decode(mel_spec)
```

### Encodec

```python
from vocos_mlx import Vocos, load_audio

audio = load_audio("audio.wav", 24_000)

vocos = Vocos.from_pretrained("lucasnewman/vocos-encodec-24khz")

# reconstruct
reconstructed = vocos(audio, bandwidth_id = 3)
audio = load_audio("audio.wav", 24_000)
reconstructed_audio = vocos(audio, bandwidth_id = 3)

# decode with encodec codes
codes = ...
Expand Down

0 comments on commit bc78eff

Please sign in to comment.