Using the beep function in shiny

Hello!

I have a toy example which plays a "beep" on my laptop. However, it does not play the sound from the shinyapps.io server. Here is the code

ui <- fluidPage(
  selectInput("Ind","Indipendent Variable",choices = names(mtcars)),
  selectInput('Dep','  Dependent Variable',choices = names(mtcars)),
  plotOutput('Hist')
)
server <- function(input, output, session) {
library(beepr)

  data1 <- reactive({
    input$Ind
  })
  data2 <- reactive({
    input$Dep
  })


  output$Hist <- renderPlot({
    req(data1())
    beep(3)
    hist(mtcars[[data1()]])
  }) 

}

shinyApp(ui, server)

Any suggestions on how to hear the beep from the server, please?
Thanks,
Erin

Hello,

Your answer can be found here: r - How to make a Shiny App beep / play a sound after a reactive event? - Stack Overflow. In that thread they say " The beep.wav file should be located in the /www directory of the shiny app for the audio Tag to work, see following post."

Thank you! This is a big help.

Great :slight_smile: If it solves your problem feel free to mark it as the solution

Just did!

Thanks again

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.