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-1.0.2.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for pyaudiocook-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44c939d470e6c48aac288814336e08d2fe5b1098592ff090e0cbd8b297d43d4a |
|
MD5 | 623f45b6d409002b1ab4bcb464fdac19 |
|
BLAKE2b-256 | 86a1a919768007581afbe19fd99829947dfbf13138ecd0ce8a1b14e96f3c4856 |