Update of /cvsroot/pywin32/pywin32/com/win32comext/directsound/test
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24802/com/win32comext/directsound/test
Modified Files:
ds_record.py ds_test.py
Log Message:
Various modernizations to .py code via the py3k branch.
Index: ds_record.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/directsound/test/ds_record.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ds_record.py 7 Mar 2005 22:18:45 -0000 1.1
--- ds_record.py 14 Nov 2008 00:22:25 -0000 1.2
***************
*** 1,5 ****
import pywintypes
import struct
! import win32event
import win32com.directsound.directsound as ds
--- 1,6 ----
import pywintypes
import struct
! import win32event, win32api
! import os
import win32com.directsound.directsound as ds
***************
*** 38,42 ****
data = buffer.Update(0, 352800)
! f = open('recording.wav', 'wb')
f.write(wav_header_pack(sdesc.lpwfxFormat, 352800))
f.write(data)
--- 39,45 ----
data = buffer.Update(0, 352800)
! fname=os.path.join(win32api.GetTempPath(), 'test_directsound_record.wav')
! f = open(fname, 'wb')
f.write(wav_header_pack(sdesc.lpwfxFormat, 352800))
f.write(data)
+ f.close()
Index: ds_test.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/directsound/test/ds_test.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ds_test.py 7 Mar 2005 22:18:45 -0000 1.4
--- ds_test.py 14 Nov 2008 00:22:25 -0000 1.5
***************
*** 4,8 ****
import os
import pywintypes
! import win32event
import win32com.directsound.directsound as ds
# next two lines are for for debugging:
--- 4,9 ----
import os
import pywintypes
! import win32event, win32api
! import os
import win32com.directsound.directsound as ds
# next two lines are for for debugging:
***************
*** 24,28 ****
# fmt chuck is not first chunk, directly followed by data chuck
# It is nowhere required that they are, it is just very common
! raise ValueError, 'cannot understand wav header'
wfx = pywintypes.WAVEFORMATEX()
--- 25,29 ----
# fmt chuck is not first chunk, directly followed by data chuck
# It is nowhere required that they are, it is just very common
! raise ValueError('cannot understand wav header')
wfx = pywintypes.WAVEFORMATEX()
***************
*** 329,334 ****
data = buffer.Update(0, 352800)
!
! f = open('recording.wav', 'wb')
f.write(wav_header_pack(sdesc.lpwfxFormat, 352800))
f.write(data)
--- 330,335 ----
data = buffer.Update(0, 352800)
! fname=os.path.join(win32api.GetTempPath(), 'test_directsound_record.wav')
! f = open(fname, 'wb')
f.write(wav_header_pack(sdesc.lpwfxFormat, 352800))
f.write(data)
|