Anonymous avatar Anonymous committed 73a01c8

Comments (0)

Files changed (1)

pygame/sndarray.py

 
     :rtype: Numeric, numpy or numarray array
     '''
-    chunk = sound._chunk
-
-    ready, frequency, format, channels = Mix_QuerySpec()
-    if not ready:
-        raise pygame.base.error, 'Mixer not initialized'
-
-    formatbytes = (format & 0xff) >> 3
-    if channels == 1:
-        shape = (chunk.alen / formatbytes,)
-    else:
-        shape = (chunk.alen / formatbytes / 2, 2)
-
-    signed = format in (AUDIO_S8, AUDIO_S16LSB, AUDIO_S16MSB)
-
-    return pygame.array._array_from_string(chunk.abuf.to_string(), formatbytes,
-                                           shape, signed)
+    return _as_array(sound).copy()
 
 def samples(sound):
     '''Reference Sound samples into an array.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.