Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

228
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda