From 2a1d5bef1c08a8f688a780ffc0ea511d9ee1f133 Mon Sep 17 00:00:00 2001 From: Hellow2 Date: Wed, 5 Apr 2023 12:59:00 +0200 Subject: [PATCH] started implementing of audio codex --- src/music_kraken/audio/__init__.py | 7 +++++++ src/music_kraken/audio/codex.py | 8 ++++++++ src/music_kraken/{tagging/id3.py => audio/metadata.py} | 0 src/music_kraken/pages/abstract.py | 2 +- src/music_kraken/tagging/__init__.py | 6 ------ src/music_kraken/utils/shared.py | 2 ++ 6 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 src/music_kraken/audio/__init__.py create mode 100644 src/music_kraken/audio/codex.py rename src/music_kraken/{tagging/id3.py => audio/metadata.py} (100%) delete mode 100644 src/music_kraken/tagging/__init__.py diff --git a/src/music_kraken/audio/__init__.py b/src/music_kraken/audio/__init__.py new file mode 100644 index 0000000..824376b --- /dev/null +++ b/src/music_kraken/audio/__init__.py @@ -0,0 +1,7 @@ +from . import metadata +from . import codex + +AudioMetadata = metadata.AudioMetadata +write_many_metadata = metadata.write_many_metadata +write_metadata = metadata.write_metadata +write_metadata_to_target = metadata.write_metadata_to_target diff --git a/src/music_kraken/audio/codex.py b/src/music_kraken/audio/codex.py new file mode 100644 index 0000000..7b72e75 --- /dev/null +++ b/src/music_kraken/audio/codex.py @@ -0,0 +1,8 @@ +import ffmpeg + +from ..utils.shared import BITRATE +from ..objects import Target + +def correct_codex(target: Target, bitrate: int = BITRATE): + if not target.exists: + pass diff --git a/src/music_kraken/tagging/id3.py b/src/music_kraken/audio/metadata.py similarity index 100% rename from src/music_kraken/tagging/id3.py rename to src/music_kraken/audio/metadata.py diff --git a/src/music_kraken/pages/abstract.py b/src/music_kraken/pages/abstract.py index 7dd01ec..3758139 100644 --- a/src/music_kraken/pages/abstract.py +++ b/src/music_kraken/pages/abstract.py @@ -21,7 +21,7 @@ from ..objects import ( Label, AlbumType ) -from ..tagging import write_metadata_to_target +from ..audio import write_metadata_to_target from ..utils import shared diff --git a/src/music_kraken/tagging/__init__.py b/src/music_kraken/tagging/__init__.py deleted file mode 100644 index bec0412..0000000 --- a/src/music_kraken/tagging/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -from . import id3 - -AudioMetadata = id3.AudioMetadata -write_many_metadata = id3.write_many_metadata -write_metadata = id3.write_metadata -write_metadata_to_target = id3.write_metadata_to_target diff --git a/src/music_kraken/utils/shared.py b/src/music_kraken/utils/shared.py index c6dc2a0..5e3a2ab 100644 --- a/src/music_kraken/utils/shared.py +++ b/src/music_kraken/utils/shared.py @@ -113,6 +113,8 @@ DEFAULT_VALUES = { "song": "Various Song", "album_type": "Other" } +# kB per second +BITRATE = 100 # size of the chunks that are streamed CHUNK_SIZE = 1024