bioamla 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
bioamla/__init__.py ADDED
File without changes
bioamla/globals.py ADDED
@@ -0,0 +1 @@
1
+ supported_audio_file_extensions = [".wav", ".mp3", ".ogg", ".flac", ".mp4"]
bioamla/wav.py ADDED
@@ -0,0 +1,20 @@
1
+ from novus_pytils.files import get_files_by_extension
2
+
3
+ def get_wav_metadata(wav_filepath : str) -> dict:
4
+ import wave
5
+ with wave.open(wav_filepath, 'rb') as wav_file:
6
+ return {
7
+ "filepath": wav_filepath,
8
+ "file_size": wav_file.getnframes() * wav_file.getnchannels() * wav_file.getsampwidth(),
9
+ "num_channels": wav_file.getnchannels(),
10
+ "sample_width": wav_file.getsampwidth(),
11
+ "frame_rate": wav_file.getframerate(),
12
+ "num_frames": wav_file.getnframes(),
13
+ "duration": wav_file.getnframes() / wav_file.getframerate()
14
+ }
15
+
16
+ def get_wav_files_metadata(wav_files : list) -> list:
17
+ return [get_wav_metadata(wav_file) for wav_file in wav_files]
18
+
19
+ def get_wav_files(directory : str) -> list:
20
+ return get_files_by_extension(directory, ['.wav'])
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.4
2
+ Name: bioamla
3
+ Version: 0.0.1
4
+ Summary: Bioacoustics & Machine Learning Applications
5
+ Project-URL: Homepage, https://github.com/jmcmeen/bioamla
6
+ Author-email: John McMeen <johnmcmeen@gmail.com>
7
+ Classifier: Operating System :: OS Independent
8
+ Classifier: Programming Language :: Python :: 3
9
+ Requires-Python: >=3.8
10
+ Requires-Dist: novus-pytils
11
+ Description-Content-Type: text/markdown
12
+
13
+ # bioamla
@@ -0,0 +1,6 @@
1
+ bioamla/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ bioamla/globals.py,sha256=5XY6s10_agjxUz19xhzhLLTCUKzK_8-gzxa9ct5ygm4,76
3
+ bioamla/wav.py,sha256=Cid-ziF_D11aPbMzGj81RJR96Lm17zJMnh9lIUJ1kIw,840
4
+ bioamla-0.0.1.dist-info/METADATA,sha256=zuY8SvzYstefPA1A3m0XKrZvgotpf4UEf-m8pYCB-34,408
5
+ bioamla-0.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
+ bioamla-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any