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
9d8fe648
Kaydet (Commit)
9d8fe648
authored
Agu 09, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
rather ugly temporary hacks to make it work in grail & restricted mode
üst
6a0691ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
audiodev.py
Lib/audiodev.py
+14
-11
No files found.
Lib/audiodev.py
Dosyayı görüntüle @
9d8fe648
...
@@ -2,7 +2,7 @@ error = 'audiodev.error'
...
@@ -2,7 +2,7 @@ error = 'audiodev.error'
class
Play_Audio_sgi
:
class
Play_Audio_sgi
:
# Private instance variables
# Private instance variables
access
frameratelist
,
nchannelslist
,
sampwidthlist
,
oldparams
,
\
if
0
:
access
frameratelist
,
nchannelslist
,
sampwidthlist
,
oldparams
,
\
params
,
config
,
inited_outrate
,
inited_width
,
\
params
,
config
,
inited_outrate
,
inited_width
,
\
inited_nchannels
,
port
,
converter
,
classinited
:
private
inited_nchannels
,
port
,
converter
,
classinited
:
private
...
@@ -11,7 +11,7 @@ class Play_Audio_sgi:
...
@@ -11,7 +11,7 @@ class Play_Audio_sgi:
def
initclass
(
self
):
def
initclass
(
self
):
import
AL
import
AL
Play_Audio_sgi
.
frameratelist
=
[
self
.
frameratelist
=
[
(
48000
,
AL
.
RATE_48000
),
(
48000
,
AL
.
RATE_48000
),
(
44100
,
AL
.
RATE_44100
),
(
44100
,
AL
.
RATE_44100
),
(
32000
,
AL
.
RATE_32000
),
(
32000
,
AL
.
RATE_32000
),
...
@@ -20,16 +20,16 @@ class Play_Audio_sgi:
...
@@ -20,16 +20,16 @@ class Play_Audio_sgi:
(
11025
,
AL
.
RATE_11025
),
(
11025
,
AL
.
RATE_11025
),
(
8000
,
AL
.
RATE_8000
),
(
8000
,
AL
.
RATE_8000
),
]
]
Play_Audio_sgi
.
nchannelslist
=
[
self
.
nchannelslist
=
[
(
1
,
AL
.
MONO
),
(
1
,
AL
.
MONO
),
(
2
,
AL
.
STEREO
),
(
2
,
AL
.
STEREO
),
]
]
Play_Audio_sgi
.
sampwidthlist
=
[
self
.
sampwidthlist
=
[
(
1
,
AL
.
SAMPLE_8
),
(
1
,
AL
.
SAMPLE_8
),
(
2
,
AL
.
SAMPLE_16
),
(
2
,
AL
.
SAMPLE_16
),
(
3
,
AL
.
SAMPLE_24
),
(
3
,
AL
.
SAMPLE_24
),
]
]
Play_Audio_sgi
.
classinited
=
1
self
.
classinited
=
1
def
__init__
(
self
):
def
__init__
(
self
):
import
al
,
AL
import
al
,
AL
...
@@ -129,14 +129,14 @@ class Play_Audio_sgi:
...
@@ -129,14 +129,14 @@ class Play_Audio_sgi:
return
self
.
config
.
getqueuesize
()
return
self
.
config
.
getqueuesize
()
# private methods
# private methods
access
*
:
private
if
0
:
access
*
:
private
def
ulaw2lin
(
self
,
data
):
def
ulaw2lin
(
self
,
data
):
import
audioop
import
audioop
return
audioop
.
ulaw2lin
(
data
,
2
)
return
audioop
.
ulaw2lin
(
data
,
2
)
class
Play_Audio_sun
:
class
Play_Audio_sun
:
access
outrate
,
sampwidth
,
nchannels
,
inited_outrate
,
inited_width
,
\
if
0
:
access
outrate
,
sampwidth
,
nchannels
,
inited_outrate
,
inited_width
,
\
inited_nchannels
,
converter
:
private
inited_nchannels
,
converter
:
private
def
__init__
(
self
):
def
__init__
(
self
):
...
@@ -176,11 +176,12 @@ class Play_Audio_sun:
...
@@ -176,11 +176,12 @@ class Play_Audio_sun:
info
.
o_channels
=
self
.
nchannels
info
.
o_channels
=
self
.
nchannels
if
self
.
sampwidth
==
0
:
if
self
.
sampwidth
==
0
:
info
.
o_precision
=
8
info
.
o_precision
=
8
self
.
o_encoding
=
ENCODING_ULAW
self
.
o_encoding
=
SUNAUDIODEV
.
ENCODING_ULAW
# XXX Hack, hack -- leave defaults
else
:
else
:
info
.
o_precision
=
8
*
self
.
sampwidth
info
.
o_precision
=
8
*
self
.
sampwidth
info
.
o_encoding
=
SUNAUDIODEV
.
ENCODING_LINEAR
info
.
o_encoding
=
SUNAUDIODEV
.
ENCODING_LINEAR
self
.
port
.
setinfo
(
info
)
self
.
port
.
setinfo
(
info
)
if
self
.
converter
:
if
self
.
converter
:
data
=
self
.
converter
(
data
)
data
=
self
.
converter
(
data
)
self
.
port
.
write
(
data
)
self
.
port
.
write
(
data
)
...
@@ -209,7 +210,6 @@ class Play_Audio_sun:
...
@@ -209,7 +210,6 @@ class Play_Audio_sun:
def
AudioDev
():
def
AudioDev
():
try
:
try
:
import
al
import
al
return
Play_Audio_sgi
()
except
ImportError
:
except
ImportError
:
try
:
try
:
import
sunaudiodev
import
sunaudiodev
...
@@ -217,9 +217,12 @@ def AudioDev():
...
@@ -217,9 +217,12 @@ def AudioDev():
except
ImportError
:
except
ImportError
:
try
:
try
:
import
Audio_mac
import
Audio_mac
return
Audio_mac
.
Play_Audio_mac
()
except
ImportError
:
except
ImportError
:
raise
error
,
'no audio device'
raise
error
,
'no audio device'
else
:
return
Audio_mac
.
Play_Audio_mac
()
else
:
return
Play_Audio_sgi
()
def
test
(
fn
=
'f:just samples:just.aif'
):
def
test
(
fn
=
'f:just samples:just.aif'
):
import
aifc
import
aifc
...
...
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