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.1.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for pyaudiocook-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ada7a4f199a5aab844da744a8a10e90dde8cd194f6cc39b78328f79b7c262b96 |
|
MD5 | b8deff3d58b2ffcd5fe9f52a3a5da993 |
|
BLAKE2b-256 | 4a6aecdfabba0a78af9088e947f8f36031d819bbe2b56d909787252546aeba44 |