Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbgruber/whisprrr
https://github.com/jbgruber/whisprrr
Last synced: 30 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jbgruber/whisprrr
- Owner: JBGruber
- License: gpl-3.0
- Created: 2024-04-28T07:33:20.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-04-28T08:30:41.000Z (8 months ago)
- Last Synced: 2024-10-15T04:10:06.677Z (2 months ago)
- Language: R
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE.md
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# whisprrr
`whisprrr` is just a minimal wrapper for the Python package [Whisper](https://github.com/openai/whisper) by OpenAI:
> Whisper is a general-purpose speech recognition model. It is trained on a large dataset of diverse audio and is also a multitasking model that can perform multilingual speech recognition, speech translation, and language identification.
Besides making it possible to transcribe audio to text, the purpose of this repository is also to have a minimal R wrapper for a Python package.
## Installation
You can install the development version of whisprrr from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("JBGruber/whisprrr")
```Then use `install_whisper` to set up the required Python environment (and install Python if necessary):
```r
install_whisper()
```The process should be fully automatic/guided.
By default, the environment is set up as r-whisper" in the folder returned by `reticulate::virtualenv_root()`.
If you want to change that, the best way is to set RETICULATE_PYTHON_ENV before running `install_whisper()`:```r
Sys.setenv(RETICULATE_PYTHON_ENV = "my-env")
```Note that you have to set this environment variable in every new session or put it into your .Renviron file(e.g., with `usethis::edit_r_environ()`).
## Example
This is a basic example which shows you how to solve a common problem:
```{r example}
library(whisprrr)
download.file("https://github.com/openai/whisper/raw/main/tests/jfk.flac", "jfk.flac")
transcript_df <- transcribe("jfk.flac")
transcript_df
transcript_df$text
```# Alternatives
- [audio.whisper](https://github.com/bnosac/audio.whisper)