Skip to content

TypeError: expected str, bytes or os.PathLike object, not SpooledTemporaryFile #74

@Shivamagrawal2014

Description

@Shivamagrawal2014

Hi,
I am trying to load my byte data that is in binary format into audioread.audio_open, ideally I should directly give path for the audio file but I am trying to decode the mp3 after loading my audio file into tensorflow and there arises the issue.

Complete Trace Back is as Follows:
`TypeError Traceback (most recent call last)
in ()
----> 1 au = aio(buffer)

c:\users\shivam.agarwal\pycharmprojects\audioapi\venv\lib\site-packages\audioread_init_.py in audio_open(path)
78 from . import rawread
79 try:
---> 80 return rawread.RawAudioFile(path)
81 except DecodeError:
82 pass

c:\users\shivam.agarwal\pycharmprojects\audioapi\venv\lib\site-packages\audioread\rawread.py in init(self, filename)
59 """
60 def init(self, filename):
---> 61 self._fh = open(filename, 'rb')
62
63 try:
`

I tried to load the bytes as file-like object from SpooledTemporaryFile but this open in 'rb' format keeps giving the issue.

How should I load the bytes as file-like object ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions