Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1801aad

Browse files
committed
Use MacOS.string_id_to_buffer for id() to buffer address hack
1 parent 4240b61 commit 1801aad

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Mac/Lib/Audio_mac.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def writeframes(self, data):
4242
import time
4343
from Sound import *
4444
import struct
45+
import MacOS
4546
if not self._chan:
4647
import Snd
4748
self._chan = Snd.SndNewChannel(5, 0, self._callback)
@@ -56,7 +57,7 @@ def writeframes(self, data):
5657
import audioop
5758
data = audioop.add(data, '\x80'*len(data), 1)
5859
h1 = struct.pack('llhhllbbl',
59-
id(data)+12,
60+
id(data)+MacOS.string_id_to_data,
6061
self._nchannels,
6162
self._outrate, 0,
6263
0,

0 commit comments

Comments
 (0)