pyaudiocook


Namepyaudiocook JSON
Version 1.0.2 PyPI version JSON
download
home_pageNone
SummaryA Python package for audio recording and transcribing
upload_time2024-08-22 12:28:57
maintainerNone
docs_urlNone
authorJesse Wei
requires_python<4.0,>=3.11
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyaudiocook

A Python package for recording and transcribing audio.

- [pyaudiocook](#pyaudiocook)
  - [Installation](#installation)
  - [Usage](#usage)
    - [AudioRecorder](#audiorecorder)
      - [Example: start recording](#example-start-recording)
      - [Example: pause/resume recording](#example-pauseresume-recording)
      - [Example: stop recording](#example-stop-recording)
    - [AudioTranscriber](#audiotranscriber)
      - [Example: Local whisper model and single audio file](#example-local-whisper-model-and-single-audio-file)
      - [Example: Local whisper model and multiple audio file](#example-local-whisper-model-and-multiple-audio-file)
      - [Example: Calling OpenAI API](#example-calling-openai-api)
      - [Example: Using another model](#example-using-another-model)

## Installation

```bash
pip install pyaudiocook
```

## Usage

The package contains two classes: `AudioRecorder` and `AudioTranscriber`.

### AudioRecorder

#### Example: start recording

```python
recorder = AudioRecorder()
recorder.start_recording()
```

#### Example: pause/resume recording

```python
recorder = AudioRecorder()
recorder.toggle_recording()
```

#### Example: stop recording

```python
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](https://platform.openai.com/docs/quickstart/create-and-export-an-api-key) to create one.

#### Example: Local whisper model and single audio file

```python
# 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

```python
# 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.*

```python
# 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*

```python
# Default is tiny.en
transcriber = AudioTranscriber('audio_1.wav', 'audio_2.wav', mode='local', model='base.en')
transcriber.transcribe()
print(transcriber.texts)
```


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyaudiocook",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.11",
    "maintainer_email": null,
    "keywords": null,
    "author": "Jesse Wei",
    "author_email": "jesseweijapan@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/bc/8c/03cf8ba3f9a4975e519a286693670342fdb77e4a976f1d7bcb8b387aa9d1/pyaudiocook-1.0.2.tar.gz",
    "platform": null,
    "description": "# pyaudiocook\n\nA Python package for recording and transcribing audio.\n\n- [pyaudiocook](#pyaudiocook)\n  - [Installation](#installation)\n  - [Usage](#usage)\n    - [AudioRecorder](#audiorecorder)\n      - [Example: start recording](#example-start-recording)\n      - [Example: pause/resume recording](#example-pauseresume-recording)\n      - [Example: stop recording](#example-stop-recording)\n    - [AudioTranscriber](#audiotranscriber)\n      - [Example: Local whisper model and single audio file](#example-local-whisper-model-and-single-audio-file)\n      - [Example: Local whisper model and multiple audio file](#example-local-whisper-model-and-multiple-audio-file)\n      - [Example: Calling OpenAI API](#example-calling-openai-api)\n      - [Example: Using another model](#example-using-another-model)\n\n## Installation\n\n```bash\npip install pyaudiocook\n```\n\n## Usage\n\nThe package contains two classes: `AudioRecorder` and `AudioTranscriber`.\n\n### AudioRecorder\n\n#### Example: start recording\n\n```python\nrecorder = AudioRecorder()\nrecorder.start_recording()\n```\n\n#### Example: pause/resume recording\n\n```python\nrecorder = AudioRecorder()\nrecorder.toggle_recording()\n```\n\n#### Example: stop recording\n\n```python\nrecorder = AudioRecorder()\nrecorder.stop_recording()\n```\n\n### AudioTranscriber\n\nBefore getting started, make sure you have already obtained an API key on OpenAI. If you have not done so, follow [this guide](https://platform.openai.com/docs/quickstart/create-and-export-an-api-key) to create one.\n\n#### Example: Local whisper model and single audio file\n\n```python\n# Transcribe using local whisper model, which is the default\ntranscriber = AudioTranscriber('audio_1.wav')\ntranscriber.transcribe()\nprint(transcriber.texts)\n```\n\n#### Example: Local whisper model and multiple audio file\n\n```python\n# You can pass multiple audio files for transcribing\ntranscriber = AudioTranscriber('audio_1.wav', 'audio_2.wav')\ntranscriber.transcribe()\nprint(transcriber.texts)\n```\n\n#### Example: Calling OpenAI API\n\n*Note: API usage fee applies.*\n\n```python\n# You can pass multiple audio files for transcribing\ntranscriber = AudioTranscriber('audio_1.wav', 'audio_2.wav', mode='remote')\ntranscriber.transcribe()\nprint(transcriber.texts)\n```\n\n#### Example: Using another model\n\n*Note: this only applies when local whisper model is used*\n\n```python\n# Default is tiny.en\ntranscriber = AudioTranscriber('audio_1.wav', 'audio_2.wav', mode='local', model='base.en')\ntranscriber.transcribe()\nprint(transcriber.texts)\n```\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python package for audio recording and transcribing",
    "version": "1.0.2",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "86a1a919768007581afbe19fd99829947dfbf13138ecd0ce8a1b14e96f3c4856",
                "md5": "623f45b6d409002b1ab4bcb464fdac19",
                "sha256": "44c939d470e6c48aac288814336e08d2fe5b1098592ff090e0cbd8b297d43d4a"
            },
            "downloads": -1,
            "filename": "pyaudiocook-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "623f45b6d409002b1ab4bcb464fdac19",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.11",
            "size": 4253,
            "upload_time": "2024-08-22T12:28:56",
            "upload_time_iso_8601": "2024-08-22T12:28:56.408316Z",
            "url": "https://files.pythonhosted.org/packages/86/a1/a919768007581afbe19fd99829947dfbf13138ecd0ce8a1b14e96f3c4856/pyaudiocook-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bc8c03cf8ba3f9a4975e519a286693670342fdb77e4a976f1d7bcb8b387aa9d1",
                "md5": "e1801678a8c9c4c696d949c47fbc09a9",
                "sha256": "01017deb7750e4751ca6a270dbe1e7f141034289336319920ffb7a830f4aa120"
            },
            "downloads": -1,
            "filename": "pyaudiocook-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e1801678a8c9c4c696d949c47fbc09a9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.11",
            "size": 3386,
            "upload_time": "2024-08-22T12:28:57",
            "upload_time_iso_8601": "2024-08-22T12:28:57.414849Z",
            "url": "https://files.pythonhosted.org/packages/bc/8c/03cf8ba3f9a4975e519a286693670342fdb77e4a976f1d7bcb8b387aa9d1/pyaudiocook-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-22 12:28:57",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pyaudiocook"
}
        
Elapsed time: 0.36905s