hello I am new to PyTorch and I want to make a simple speech recognition but I don't want to use pytorch.datasets I have some voices for dataset but I don't find anywhere to help me.
I want to use .wav files. I saw a tutorial but he used pytorch dataset.
import torch
from torch import nn, optim
import torch.nn.functional as F
import torchaudio
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
from torchaudio.datasets import SPEECHCOMMANDS
import os
class SpeechSubset(SPEECHCOMMANDS):
def __init__(self, subset, str=None):
super().__init__("./", download=True)
def load_list(filename):
filepath = os.path.join(self._path, file.name)
with open(filepath) as fileob:
return [os.path.join(self._path, line.strip())]
if subset == "validation":
self._walker = load_list("validation_list.txt")
elif subset == "testing":
self._walker = load_list("testing_list.txt")
elif subset == "training":
excludes = load_list("validation_list.txt") + load_list("testing_list.txt")
excludes = set(excludes)
self._walker = [w for w in self._walker if w not in excludes]
train_set = SpeechSubset("training")
test_set = SpeechSubset("testing")
waveform, sample_rate, label, speaker_id, utterance_number = train_set[0]
sorry my english isn't too good.
EDIT
Im using the SPEECHCOMMANDS dataset but I want to use my own
thank you for reading.