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
4a1cdd7f
Kaydet (Commit)
4a1cdd7f
authored
Eki 31, 1998
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Document the new features of this module
üst
b0d1b068
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
5 deletions
+26
-5
libsunaudio.tex
Doc/lib/libsunaudio.tex
+26
-5
No files found.
Doc/lib/libsunaudio.tex
Dosyayı görüntüle @
4a1cdd7f
...
...
@@ -18,13 +18,18 @@ describing what went wrong.
\end{excdesc}
\begin{funcdesc}
{
open
}{
mode
}
This function opens the audio device and returns a
s
un audio device
This function opens the audio device and returns a
S
un audio device
object. This object can then be used to do I/O on. The
\var
{
mode
}
parameter
is one of
\code
{
'r'
}
for record-only access,
\code
{
'w'
}
for play-only
access,
\code
{
'rw'
}
for both and
\code
{
'control'
}
for access to the
control device. Since only one process is allowed to have the recorder
or player open at the same time it is a good idea to open the device
only for the activity needed. See
\manpage
{
audio
}{
7I
}
for details.
As per the manpage, this module first looks in the environment
variable
\code
{
AUDIODEV
}
for the base audio device filename. If not
found, it falls back to
\file
{
/dev/audio
}
. The control device is
calculated by appending ``ctl'' to the base audio device.
\end{funcdesc}
...
...
@@ -33,7 +38,8 @@ only for the activity needed. See \manpage{audio}{7I} for details.
The audio device objects are returned by
\function
{
open()
}
define the
following methods (except
\code
{
control
}
objects which only provide
\method
{
getinfo()
}
,
\method
{
setinfo()
}
and
\method
{
drain()
}
):
\method
{
getinfo()
}
,
\method
{
setinfo()
}
,
\method
{
fileno()
}
, and
\method
{
drain()
}
):
\begin{methoddesc}
[audio device]
{
close
}{}
This method explicitly closes the device. It is useful in situations
...
...
@@ -41,6 +47,11 @@ where deleting the object does not immediately close it since there
are other references to it. A closed device should not be used again.
\end{methoddesc}
\begin{methoddesc}
[audio device]
{
fileno
}{}
Returns the file descriptor associated with the device. This can be
used to set up
\code
{
SIGPOLL
}
notification, as described below.
\end{methoddocs}
\begin{methoddesc}
[audio device]
{
drain
}{}
This method waits until all pending output is processed and then returns.
Calling this method is often not necessary: destroying the object will
...
...
@@ -106,6 +117,16 @@ symbolic constants like \constant{MIN_GAIN}, \constant{MAX_GAIN},
as used in the
\C
{}
include file
\code
{
<sun/audioio.h>
}
, with the
leading string
\samp
{
AUDIO
_}
stripped.
Useability of the control device is limited at the moment, since there
is no way to use the ``wait for something to happen'' feature the
device provides.
The audio device supports asynchronous notification of various events,
through the SIGPOLL signal. Here's an example of how you might enable
this in Python:
\begin{verbatim}
def handle
_
sigpoll(signum, frame):
print 'I got a SIGPOLL update'
pp
import fcntl, signal, STROPTS
signal.signal(signal.SIGPOLL, handle
_
sigpoll)
fcntl.ioctl(audio
_
obj.fileno(), STROPTS.I
_
SETSIG, STROPTS.S
_
MSG)
\end{verbatim}
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