docstr: Given a path to a file the method generates hashes for it and stores them in the database
  for later be queried.
  
  :param file_path: path to the file.
  :param song_name: song name associated to the audio file.
docstr_tok: ["Given","a","path","to","a","file","the","method","generates","hashes","for","it","and","stores","them","in","the","database","for","later","be","queried",".",":","param","file_path",":","path","to","the","file",".",":","param","song_name",":","song","name","associated","to","the","audio","file","."]
code: def fingerprint_file(
      self, file_path: str, song_name: str = None
  ) -> None:
      """
      Given a path to a file the method generates hashes for it and stores them in the database
      for later be queried.
  
      :param file_path: path to the file.
      :param song_name: song name associated to the audio file.
      """
      song_name_from_path = decoder.get_audio_name_from_path(file_path)
      song_hash = decoder.unique_hash(file_path)
      song_name = song_name or song_name_from_path
      # don't refingerprint already fingerprinted files
      if song_hash in self.songhashes_set:
          print(f"{song_name} already fingerprinted, continuing...")
      else:
          song_name, hashes, file_hash = Dejavu._fingerprint_worker(
              file_path, self.limit, song_name=song_name
          )
          sid = self.db.insert_song(song_name, file_hash)
  
          self.db.insert_hashes(sid, hashes)
          self.db.set_song_fingerprinted(sid)
          self.__load_fingerprinted_audio_hashes()
  
imports: import multiprocessing
  import os
  import sys
  import traceback
  from itertools import groupby
  from time import time
  from typing import Dict, List, Tuple
  import dejavu.logic.decoder
  from dejavu.base_classes.base_database import get_database
  from dejavu.config.settings import DEFAULT_FS, DEFAULT_OVERLAP_RATIO, DEFAULT_WINDOW_SIZE, FIELD_FILE_SHA1, FIELD_TOTAL_HASHES, FINGERPRINTED_CONFIDENCE, FINGERPRINTED_HASHES, HASHES_MATCHED, INPUT_CONFIDENCE, INPUT_HASHES, OFFSET, OFFSET_SECS, SONG_ID, SONG_NAME, TOPN
  from dejavu.logic.fingerprint import fingerprint
label_desc: Use image node_id 6 for calling the Dejavu obj's underlying member method code with example usage: obj.fingerprint_file(file_path, song_name) without return types