commit 936229bd6efeacb53784f4eca7ce7d9047ae794a Author: David Kruger Date: Tue Apr 22 12:08:47 2025 -0700 Initial frame commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1cb3e7c --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +/.env/ + +*.egg-info/ +__pycache__/ + +*.swp +*.swo +*.log diff --git a/README.md b/README.md new file mode 100644 index 0000000..fc4327d --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# DND Transcribe + +The goal of this project is to create a tool to transcribe audio recordings of +DND games and transcribe them. + +Our initial approach is rather naive, using wav2vec 2.0 pre-trained models to +perform automated speach recognition + +## Usage + +TODO diff --git a/dnd_transcribe/__init__.py b/dnd_transcribe/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/dnd_transcribe/argparse.py b/dnd_transcribe/argparse.py new file mode 100644 index 0000000..571d1d1 --- /dev/null +++ b/dnd_transcribe/argparse.py @@ -0,0 +1,19 @@ +import argparse + + +def build_argument_parser() -> argparse.ArgumentParser: + parser = argparse.ArgumentParser( + description="Utility to transcribe DND audio recordings." + ) + parser.add_argument( + "-v", "--verbose", action="store_true", help="Enable verbose logging" + ) + parser.add_argument( + "-q", "--quiet", action="store_true", help="Only display errors" + ) + parser.add_argument( + "audio_file", + type=argparse.FileType(mode="r"), + help="Audio file to process", + ) + return parser diff --git a/dnd_transcribe/main.py b/dnd_transcribe/main.py new file mode 100644 index 0000000..36d2a56 --- /dev/null +++ b/dnd_transcribe/main.py @@ -0,0 +1,15 @@ +import dnd_transcribe.argparse +import logging + + +def main(): + parser = dnd_transcribe.argparse.build_argument_parser() + args = parser.parse_args() + logging_format = "%(asctime)s %(levelname)s:%(name)s %(message)s" + if args.verbose: + logging.basicConfig(level=logging.DEBUG, format=logging_format) + elif args.quiet: + logging.basicConfig(level=logging.ERROR, format=logging_format) + else: + logging.basicConfig(level=logging.INFO, format=logging_format) + print("WIP") diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..55d6b56 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +soundfile>=0.13.1 +torch>=2.6.0 +transformers>=4.51.3 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..96dcac5 --- /dev/null +++ b/setup.py @@ -0,0 +1,30 @@ +import os +import codecs +from setuptools import setup +from setuptools import find_packages + + +def read(filename): + """Read and return `filename` in root dir of project and return string""" + here = os.path.abspath(os.path.dirname(__file__)) + return codecs.open(os.path.join(here, filename), "r").read() + + +install_requires = read("requirements.txt").split() +long_description = read("README.md") + + +setup( + name="dnd_transcribe", + version="1.0.0", + url="https://krugerlabs.us", + author="David Kruger ", + description="Script to convert D&D game audio recordings to transcripts", + long_description=long_description, + python_requires=">=3.6", + packages=find_packages(exclude=["tests"]), + install_requires=install_requires, + entry_points={"console_scripts": ["dnd_transcribe = dnd_transcribe.main:main"]}, + test_suite="nose.collector", + tests_require=["nose", "mock"], +)