How to convert an audio file (.mp3 or .wav or any other) to an unique audio id using Python?

Viewed 218

I aim to take a raw audio file as input. And my final objective is to convert that audio into an, unique for each audio, ID. Is there any python library to do it? One which takes audio as an input. One which can at least convert it to something from where I can further convert it to unique IDs? I would appreciate any suggestion of how to best approach the problem. Thanks in advance.

1 Answers

You can create a file hash of your audio file using this:

import hashlib
hashlib.md5("your audio file_path").hexdigest()

You can consider the hash generated as a unique ID

Related