__getitem__ is the process which is spawn with multiprocess.
The workload should be there (mainly the spectrograms)
As @hash-ir mentions, any other task can be performed in the __init__ function (or even outside the dataset class)
It’s all about how many RAM do you have.
Do you need to read audio in __getitem__?
Well, if your dataset fits in your RAM you can preload it in init.
You can use any python function inside __getitem__, therefore it can still be readable.