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

197
Vistas
How to get music's info from input type file in ReactJs

I have input with type="file" that only accepts a music file. I want to get information about music. For example: the name of the singer or the photo of the music.

<input type="file" className="popup-content--file" accept="audio/*" id="file" onChange={(e) => {selectMusic(e, e.currentTarget.files[0])}} />

const selectMusic = (e, file) => {
    if(file.size < 10485760 && file.type.includes('audio/')){
        const reader = new FileReader()

        reader.readAsDataURL(file)

        reader.onload = () => {
            console.log(reader)
        }
    }
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Audio file can contain metadata information stored as ID3 tags.

There are browser-based id3 parsers like this one that will help you - from their docs:

<input type="file">

<script type="module">
import * as id3 from '//unpkg.com/id3js@^2/lib/id3.js';

document
  .querySelector('input[type="file"]')
  .addEventListener('change', async (e) => {
    const tags = await id3.fromFile(e.currentTarget.files[0]);
    // tags now contains v1, v2 and merged tags
  });
</script>
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