Bonjour à tous !

Alors voilà, j'essaie de récupérer un fichier au format .dat. L'erreur est la suivant lorsque je run le code ci-dessous: AttributeError: 'tuple' object has no attribute 'flush'.

En esperant que quelqu'un aura une réponse, merci d'avance !

PS: J'espère que je ne me suis pas trompé d'endroit pour ce genre de problème...

Code source:
---------------------------------------------------
def readHRTF(name):
'''Read the hrtf data from compact format files'''
r = np.fromfile((name,'rb'), np.dtype('>i2'), 256) # <-- ligne qui génère une erreur

r.shape = (128,2)
# half the rate to 22050 and scale to 0 -> 1
r = r.astype(float)
# should use a better filter here, this is a box lowering the sample rate from 44100 to 22050
r = (r[0::2,:] + r[1::2,:]) / 65536
return r

readHRTF('HOe005.dat')

-------------------------------------------------
Erreur Générée:

File "C:/Users/Admin/Documents/HES_SO/Projet_Semestre/Python/3DSound-master/hrtf.py", line 22, in readHRTF
r = np.fromfile((name,'rb'), np.dtype('>i2'), 256)

AttributeError: 'tuple' object has no attribute 'flush'

-------------------------------------------------