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

213
Vistas
Read audio file from s3 directly in python

i want to read audio file from s3 directly in python.

First, I record audio, here is my blob settings

blob = new Blob(audioChunks,{type: 'audio/wav'});

then using django i uploaded this file to s3

req=request.POST.get('data')
d=req.split(",")[1]
file_content_io = BytesIO(base64.b64decode(d))
s3_path='audio/file_name_{}.wav'.format(random.randint(0,99))
default_storage.save(s3_path, file_content_io)

then i download file directly

from scipy.io.wavfile import read
from io import BytesIO
from urllib.request import urlopen

with urlopen(file) as response:
    audio=BytesIO(response.read())
    speech_array=read(audio)

Now its giving me following error

ValueError: File format b'OggS' not understood. Only 'RIFF' and 'RIFX' supported.

Any solution? I also tried librosa, thats also not working. The only thing i want to read file directly without saving in disk

about 4 years ago · Santiago Trujillo
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