Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

225
Views
Does R Shiny have the ability to start playing audio from a certain time stamp?

I'm building a Shiny app where users will be able to play snippets of an audio file. The time stamps are from a JSON file to mark each sentence in the audio file. To play the audio I was originally using runjs() like so:

in my input function:

tags$audio(id = "audio", controls = NA, autoplay = NA, src = "")

and in the server function:

observeEvent(input$select.file, {
        runjs(sprintf("document.getElementById('audio').src = '%s';", input$select.file))
      })

but I think this will not work for playing a certain segment of the audio. I have been looking at RStudio resources like this one on playing audio, but I haven't found anything showing how to play a section of the audio that doesn't necessarily start at the beginning.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This should work to skip e.g. the first 30 seconds:

observeEvent(input$select.file, {
  runjs(sprintf("var myaudio = document.getElementById('audio');
                     myaudio.src = '%s';
                     myaudio.currentTime = 30;", input$select.file))
})
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!