--- license: cc-by-4.0 task_categories: - text-to-speech - audio-classification tags: - emotion - voice-attributes - dacvae - speech - tts - audio pretty_name: "Emotion and Voice Attribute Reference Snippets DACVAE and Wave" size_categories: - 100K= 1.8` are included in this dataset. ## Sources - **DS1**: [TTS-AGI/enhanced-emo-snippets-balanced-DACVAE](https://huggingface.co/datasets/TTS-AGI/enhanced-emo-snippets-balanced-DACVAE) — Quality-ranked emotion/attribute snippets with speech enhancement - **DS2**: [TTS-AGI/emotion-attribute-conditioning-dacvae](https://huggingface.co/datasets/TTS-AGI/emotion-attribute-conditioning-dacvae) — Emotion/attribute conditioning pairs with speaker references - **DACVAE**: [mrfakename/dacvae-watermarked](https://huggingface.co/mrfakename/dacvae-watermarked) — DAC-VAE model for audio codec ## Usage ```python import webdataset as wds import numpy as np import json, io, soundfile as sf url = "https://huggingface.co/datasets/TTS-AGI/Emotion-Voice-Attribute-Reference-Snippets-DACVAE-Wave/resolve/main/data/Anger_4to5.tar" ds = wds.WebDataset(url).decode() for sample in ds: meta = json.loads(sample["json"]) target_wav = sample["target.wav"] # decoded 48kHz audio target_latent = np.load(io.BytesIO(sample["target.npy"])) # [T, 128] float16 if "ref.wav" in sample: ref_wav = sample["ref.wav"] # speaker reference audio ref_latent = np.load(io.BytesIO(sample["ref.npy"])) # [T, 128] float16 # Access emotion scores scores = meta.get("empathic_insight_scores") or meta.get("annotation_scores", {}) speech_quality = scores.get("score_speech_quality", 0) anger_score = scores.get("Anger", 0) ``` ## DACVAE Encode/Decode Audio was decoded from DAC-VAE latents at 48kHz, 25 latent frames/sec: ```python import torch from dacvae import DACVAE from huggingface_hub import hf_hub_download model = DACVAE.load(hf_hub_download("mrfakename/dacvae-watermarked", "weights.pth")).cuda().eval() # Decode: latent -> audio z = torch.from_numpy(latent.T).unsqueeze(0).float().cuda() # [1, 128, T_latent] audio_48k = model.decode(z).squeeze().cpu() # [T_audio] at 48kHz # Encode: audio -> latent audio = torch.from_numpy(wav).unsqueeze(0).unsqueeze(0).float().cuda() # [1, 1, T_audio] z_encoded = model.encode(audio) # [1, 128, T_latent] latent = z_encoded.squeeze(0).T.cpu().half().numpy() # [T_latent, 128] float16 ```