0

I would like to define a custom numpy array data type : for some (audio) applications, a np.int24 data type could be useful. A few remarks :

  • of course I could use np.int32 instead and forget about the lost memory space
  • or I may use some other tricks for seeing an array as a np.int8 array, and grouping them by 3, but this would involve dirty coding...

... But when using gigabytes of data, the best solution (instead of wasting 1/4 th of a np.int32) would be to define a new dtype = np.int24.

Is there a documentation showing how to do that properly ?

Remark : 24 bit audio is very common in professionnal audio applications, and when dealing with gigabytes of data, using 24 bits array would be very useful.

Basj
  • 41,386
  • 99
  • 383
  • 673
  • yes but it fits in an integer number of times a *byte*, so it could be okay, don't you think so @ramcdougal ? – Basj Mar 27 '14 at 15:28
  • possible duplicate of [How to define custom float-type numpy dtypes (C-API)](http://stackoverflow.com/questions/13659019/how-to-define-custom-float-type-numpy-dtypes-c-api) – perimosocordiae Mar 27 '14 at 15:37

0 Answers0