Commits

Leonard Ritter committed fb48e24

shortened constructor for alBufferData a little

Comments (0)

Files changed (1)

         ptr = data
     elif isinstance(data, (tuple,list)):
         ptr = _ffi.new('unsigned char[]', data)
-    else:
-        ptr = _ffi.new('char[]', data)
-    _alBufferData(buffer, format, ptr, len(data), freq)
+    else: # str
+        ptr = _ffi.new('char[{}]'.format(len(data)), data)
+    _alBufferData(buffer, format, ptr, len(ptr), freq)
 
 def alListenerfv(enum, values):
     _alListenerfv(enum, values)