Skip to content

The talk package analyses audio recordings of speech using HuggingFace transformer models. It runs in R, with a Python backend that is installed and managed automatically in a conda environment.

OS-specific instructions

  1. Install R and RStudio.

  2. In R, install talk:

    # install.packages("devtools")
    devtools::install_github("theharmonylab/talk")
  3. Install and activate the Python backend:

  1. Install R and RStudio. On Apple Silicon (M1–M4), make sure to install the arm64 build of R.

  2. In R, install talk:

    # install.packages("devtools")
    devtools::install_github("theharmonylab/talk")
  3. Install and activate the Python backend:

  1. Install R and RStudio for your distribution.

  2. Install the development libraries needed to build talk’s R dependencies from source (Ubuntu/Debian):

    sudo apt-get update
    sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev
  3. In R, install talk:

    # install.packages("devtools")
    devtools::install_github("theharmonylab/talk")
  4. Install and activate the Python backend:

  1. See which Python environments exist: talk::list_talkrpp_envs().

  2. “Python already initialized” error: restart R, then call talkrpp_initialize() before any other Python-using code.

  3. ffmpeg: no action is needed — talk finds a system ffmpeg automatically (also in locations missing from RStudio’s PATH, such as /opt/homebrew/bin) and otherwise uses the static ffmpeg installed by talkrpp_install(). If you prefer a system-wide ffmpeg, install it with your system’s package manager (brew install ffmpeg on macOS, sudo apt-get install -y ffmpeg on Ubuntu/Debian, choco install ffmpeg on Windows) — but do not install ffmpeg with conda, whose ffmpeg breaks torchaudio’s audio loading. If ffmpeg still cannot be found, re-run talkrpp_install().

  4. Reinstall the environment from scratch:

    talkrpp_uninstall(envname = "talkrpp_condaenv")
    talkrpp_install()
  5. Old or duplicated conda installations (typical symptoms: No module named 'whisnemo'; EnvironmentNameNotFound during talkrpp_install(); No matching distribution found for torch==2.11.0; talkrpp_uninstall() failing to find the environment). A talkrpp_condaenv created by an older talk version may use an old Python (3.9) and may live in a different conda installation (e.g. a personal ~/miniconda3) than the one talk now uses (reticulate’s miniconda). The fix is to remove the old environment with the conda installation that owns it, then reinstall:

    # in a terminal -- adjust the path to the conda that owns the old env
    ~/miniconda3/bin/conda env remove -n talkrpp_condaenv -y
    # then, in R
    talkrpp_install()

    talk::list_talkrpp_envs() shows which environments exist; the registrations in ~/.conda/environments.txt show which conda installation each environment belongs to.

  6. Apple Silicon (MPS): on real Apple hardware talk uses the MPS GPU automatically where it is reliable; in virtualized macOS (e.g. CI runners) it falls back to CPU.

If problems persist, please look through the closed GitHub issues or open a new issue.

Using talk and text together

The environment installed by talkrpp_install() also includes the Python packages used by the text package, so both packages can be used in the same R session. To point text at it (once):

text::textrpp_initialize(condaenv = "talkrpp_condaenv", save_profile = TRUE)

After this, all talk and text functions use the shared environment automatically. (If you prefer a leaner, talk-only environment, install with talkrpp_install(include_text = FALSE).)

Try talk in the browser

💡 Want to try talk without installing anything? Open our Google Colab notebook and run talk directly in your browser.

GitHub