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

211
Visualizações
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 à 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