How to extract embeddings in Wav2Vec2?

I’m working with audio files and i want to extract embeddings from Wav2Vec2 to use in cosine similarity. How can i do this? (I have a Wav2Vec2ForCTC pretrained model).

Thanks!