Skip to content

dsh54054/streaming-vocos

 
 

Repository files navigation

streaming-vocos

Streaming Vocos is a wrapper of Vocos. It supports streaming reconstruction of audio from mel-spectrogram or EnCodec tokens.

Usage

  • From mel-spectrogram
from streaming_vocos import StreamingVocos

audios = []
vocos = StreamingVocos()
features = vocos.feature_extractor(audio)

for feature in torch.unbind(features, dim=2):
    audios += vocos.streaming_decode(feature[:, :, None])
audios.append(vocos.decode_caches())
audios = torch.cat(audios, dim=1)
  • From EnCodec tokens
from streaming_vocos import StreamingVocos

audios = []
vocos = StreamingVocos()
codes = vocos.get_encodec_codes(audio)

for code in torch.unbind(codes, dim=2):
    audios += vocos.streaming_decode_codes(code[:, :, None])
audios.append(vocos.decode_caches())
audios = torch.cat(audios, dim=1)

About

Streaming Vocos

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%