Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl9Doniz committed Apr 30, 2024
1 parent f36d833 commit eacb633
Show file tree
Hide file tree
Showing 19 changed files with 16 additions and 50 deletions.
Binary file added .DS_Store
Binary file not shown.
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/Shazam_python_LA.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/profiles_settings.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

Binary file removed Rain Over Me (feat. Marc Anthony).wav
Binary file not shown.
Binary file modified __pycache__/hashes.cpython-310.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion constellations.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ def create_constellation(audio, Fs, chunk_size=1000):
if __name__ == "__main__":
Fs, audio_input = read("Rain Over Me.wav")
constellation = create_constellation(audio_input, Fs)
print(constellation)
print(constellation)
Binary file added data/Can't Stop.wav
Binary file not shown.
Binary file added data/Highway to Hell.wav
Binary file not shown.
File renamed without changes.
2 changes: 1 addition & 1 deletion database.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from constellations import create_constellation
from hashes import create_hashes

songs = glob.glob('Rain Over Me.wav')
songs = glob.glob('data/*.wav')

song_index = {}
database: Dict[int, List[Tuple[int, int]]] = {}
Expand Down
3 changes: 1 addition & 2 deletions finding.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
from constellations import create_constellation
from hashes import create_hashes

Fs, audio_input = read("Rain Over Me.wav")
Fs, audio_input = read("data/Rain Over Me.wav")

constellation = create_constellation(audio_input, Fs)
hashes = create_hashes(constellation, None)

# %%
database = pickle.load(open('database.pickle', 'rb'))
song_index_lookup = pickle.load(open("song_index.pickle", "rb"))

Expand Down
1 change: 0 additions & 1 deletion hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
upper_frequency = 23_000
frequency_bits = 10


def create_hashes(constellation_map, song_id=None):
hashes = {}
for idx, (time, freq) in enumerate(constellation_map):
Expand Down
10 changes: 10 additions & 0 deletions read_from_db.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import pickle



with open("song_index.pickle", "rb") as index_file:
song_index = pickle.load(index_file)

# Print the song index
for index, filename in song_index.items():
print(f"Index: {index}, Filename: {filename}")
Binary file modified song_index.pickle
Binary file not shown.
3 changes: 3 additions & 0 deletions tempCodeRunnerFile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Print the song index
for index, filename in database.items():
print(f"Index: {index}, Filename: {filename}")

0 comments on commit eacb633

Please sign in to comment.