Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
2cc340d1
Kaydet (Commit)
2cc340d1
authored
Şub 02, 1999
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Windows sound playing module, by Fredrik Lundh.
üst
246bc17a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
winsound.c
Modules/winsound.c
+71
-0
No files found.
Modules/winsound.c
0 → 100644
Dosyayı görüntüle @
2cc340d1
/*
* SOUND
* $Id$
*
* play sound on a windows platform
*
* history:
* 99-02-02 fl created
*
* Copyright (c) 1999 by Secret Labs AB.
* Copyright (c) 1999 by Fredrik Lundh.
*
* fredrik@pythonware.com
* http://www.pythonware.com
*
* --------------------------------------------------------------------
* Permission to use, copy, modify, and distribute this software and
* its associated documentation for any purpose and without fee is
* hereby granted. This software is provided as is.
* --------------------------------------------------------------------
*/
#include "Python.h"
#include "windows.h"
#include "mmsystem.h"
static
PyObject
*
_play
(
PyObject
*
self
,
PyObject
*
args
)
{
int
result
;
/* first argument is a string that should contain the contents of
a WAV file. second argument should be non-zero to wait for the
sound to complete. */
char
*
data
=
NULL
;
int
bytes
;
int
wait
=
0
;
if
(
!
PyArg_ParseTuple
(
args
,
"|s#i"
,
&
data
,
&
bytes
,
&
wait
))
return
NULL
;
result
=
PlaySound
(
data
,
NULL
,
(
SND_MEMORY
|
SND_NOWAIT
|
SND_NODEFAULT
)
|
(
wait
?
0
:
SND_ASYNC
));
return
Py_BuildValue
(
"i"
,
result
);
}
static
PyObject
*
_stop
(
PyObject
*
self
,
PyObject
*
args
)
{
if
(
!
PyArg_NoArgs
(
args
))
return
NULL
;
return
Py_BuildValue
(
"i"
,
PlaySound
(
NULL
,
NULL
,
0
));
}
static
PyMethodDef
_functions
[]
=
{
{
"play"
,
_play
,
1
},
{
"stop"
,
_stop
,
0
},
{
NULL
,
NULL
}
};
void
#ifdef WIN32
__declspec
(
dllexport
)
#endif
initwinsound
()
{
Py_InitModule
(
"winsound"
,
_functions
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment