Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

223
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda