Kaydet (Commit) 1801aad5 authored tarafından Jack Jansen's avatar Jack Jansen

Use MacOS.string_id_to_buffer for id() to buffer address hack

üst 4240b610
...@@ -42,6 +42,7 @@ class Play_Audio_mac: ...@@ -42,6 +42,7 @@ class Play_Audio_mac:
import time import time
from Sound import * from Sound import *
import struct import struct
import MacOS
if not self._chan: if not self._chan:
import Snd import Snd
self._chan = Snd.SndNewChannel(5, 0, self._callback) self._chan = Snd.SndNewChannel(5, 0, self._callback)
...@@ -56,7 +57,7 @@ class Play_Audio_mac: ...@@ -56,7 +57,7 @@ class Play_Audio_mac:
import audioop import audioop
data = audioop.add(data, '\x80'*len(data), 1) data = audioop.add(data, '\x80'*len(data), 1)
h1 = struct.pack('llhhllbbl', h1 = struct.pack('llhhllbbl',
id(data)+12, id(data)+MacOS.string_id_to_data,
self._nchannels, self._nchannels,
self._outrate, 0, self._outrate, 0,
0, 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment