Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
R
 
 
 
 
 
 
 
 
man
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

wavesurfer

CRAN status Lifecycle: experimental

An interactive soundwave player and visualizer with rich set of plugins. It works well with pipe (%>%) and can be used in Shiny. It is an interface of ‘wavesurfer.js’ JavaScript library and it is based on ‘htmlwidgets’ R package.

Installation

# install.packages("remotes")
remotes::install_github("Athospd/wavesurfer")

Using in Shiny

Usage at shiny app:

library(wavesurfer)
library(shiny)

ui <- fluidPage(
  wavesurferOutput("my_ws"),
  tags$p("Press spacebar to toggle play/pause."),
  actionButton("mute", "Mute", icon = icon("volume-off"))
)

server <- function(input, output, session) {
  output$my_ws <- renderWavesurfer({
    wavesurfer(audio = "http://ia902606.us.archive.org/35/items/shortpoetry_047_librivox/song_cjrg_teasdale_64kb.mp3") %>%
      ws_set_wave_color('#5511aa') %>%
      ws_spectrogram() %>%
      ws_cursor()
  })
  
  observeEvent(input$mute, {
    ws_toggle_mute("my_ws")
  })
}

shinyApp(ui = ui, server = server)

annotator_app()

The goal of annotator_app() is to provide an quick way to one start annotating their audio. It requires two inputs:

  • wavs_folder a string with the path to the wave files folder.
  • annotations_folder a string with where to store the annotations (as a .rds contaning a tibble)
# This is a working code!
annotator_app(
  wavs_folder = system.file("wav", package = "wavesurfer"), 
  annotations_folder = tempdir()
)

Live examples

Annotator

live app: athos.shinyapps.io/wavesurfer_annotator/

wavesurfer::runExample("annotator")

Plugins

live app: athos.shinyapps.io/wavesurfer_plugins/

wavesurfer::runExample("plugins")

Wave Decorations

live app: athos.shinyapps.io/wavesurfer_decoration/

wavesurfer::runExample("decoration")

Acknowledgement

The main actors that made this package possible were:

Thank you very much for your work.

About

R interface to wavesurfer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages