A Python package for audio recording and transcribing
Project description
pyaudiocook
A Python package for recording and transcribing audio.
Installation
pip install pyaudiocook
Usage
The package contains two classes: AudioRecorder
and AudioTranscriber
.
AudioRecorder
Example: start recording
recorder = AudioRecorder()
recorder.start_recording()
Example: pause/resume recording
recorder = AudioRecorder()
recorder.toggle_recording()
Example: stop recording
recorder = AudioRecorder()
recorder.stop_recording()
AudioTranscriber
Before getting started, make sure you have already obtained an API key on OpenAI. If you have not done so, follow this guide to create one.
Example: Local whisper model and single audio file
# Transcribe using local whisper model, which is the default
transcriber = AudioTranscriber('audio_1.wav')
transcriber.transcribe()
print(transcriber.texts)
Example: Local whisper model and multiple audio file
# You can pass multiple audio files for transcribing
transcriber = AudioTranscriber('audio_1.wav', 'audio_2.wav')
transcriber.transcribe()
print(transcriber.texts)
Example: Calling OpenAI API
Note: API usage fee applies.
# You can pass multiple audio files for transcribing
transcriber = AudioTranscriber('audio_1.wav', 'audio_2.wav', mode='remote')
transcriber.transcribe()
print(transcriber.texts)
Example: Using another model
Note: this only applies when local whisper model is used
# Default is tiny.en
transcriber = AudioTranscriber('audio_1.wav', 'audio_2.wav', mode='local', model='base.en')
transcriber.transcribe()
print(transcriber.texts)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyaudiocook-0.1.0.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for pyaudiocook-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14703e67aaff595eb36ccaabb525cf1c494da28ed3c424337b592fdf74ae8175 |
|
MD5 | df0cc7f8ad923546007a814a82dbd827 |
|
BLAKE2b-256 | 0311e59d20504756eae9dcedf0e982c821c869f9bf93ecb9c638c213cf9defaf |