0

How can I compare two audio files and check the match? I tried importing the file and dividing it into parts and checking if each part was in the other file, but the code didn't work. It makes sense to have small problems in one of the files and still the software will be able to recognize that the (songs) are the same

2 Answers2

0

If you want to check each file is identical you can hash each file and compare hashes.

A hash is a unique string that corresponds to a specific bit of data.

Here is how you can do it in Python: Hashing a file in Python

If you're on a Linux system you could use:

md5sum file1

On Windows Powershell:

Get-FileHash file1 -Algorithm MD5
Adam
  • 709
  • 4
  • 16
  • How can this help me? –  Mar 18 '20 at 07:31
  • 1
    Well you're checking if two files match (the same)? Or am I mistaken? – Adam Mar 18 '20 at 07:34
  • Yes, but there can be small errors in one of the files and I want the code to still recognize that they are asking them (songs) audio files –  Mar 18 '20 at 07:36
  • Ok, no worries - my answer isn't relevant. Please update your question with that information – Adam Mar 18 '20 at 07:37
0

You can do the following to compare audio files -

A. Check this lib https://pypi.org/project/audiodiff/

B. Use scipy/librosa kind of libs to do following -

  1. Comparing Fourier components (FFT-fast Fourier transformation) of two files

  2. Getting audio fingerprints of two audios and comparing

codinnvrends
  • 264
  • 2
  • 8