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
abd9a597
Kaydet (Commit)
abd9a597
authored
Tem 25, 2008
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Forward-port r65112 so that test_ossaudiodev uses sunau.
üst
d4d478d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
test_ossaudiodev.py
Lib/test/test_ossaudiodev.py
+10
-9
No files found.
Lib/test/test_ossaudiodev.py
Dosyayı görüntüle @
abd9a597
...
...
@@ -6,7 +6,7 @@ from test.support import findfile, TestSkipped
import
errno
import
ossaudiodev
import
sys
import
sunau
dio
import
sunau
import
time
import
audioop
import
unittest
...
...
@@ -22,15 +22,16 @@ except ImportError:
AFMT_S16_NE
=
ossaudiodev
.
AFMT_S16_BE
SND_FORMAT_MULAW_8
=
1
def
read_sound_file
(
path
):
fp
=
open
(
path
,
'rb'
)
size
,
enc
,
rate
,
nchannels
,
extra
=
sunaudio
.
gethdr
(
fp
)
data
=
fp
.
read
()
fp
.
close
()
if
enc
!=
SND_FORMAT_MULAW_8
:
with
open
(
path
,
'rb'
)
as
fp
:
au
=
sunau
.
open
(
fp
)
rate
=
au
.
getframerate
()
nchannels
=
au
.
getnchannels
()
encoding
=
au
.
_encoding
fp
.
seek
(
0
)
data
=
fp
.
read
()
if
encoding
!=
sunau
.
AUDIO_FILE_ENCODING_MULAW_8
:
raise
RuntimeError
(
"Expect .au file with 8-bit mu-law samples"
)
# Convert the data to 16-bit signed.
...
...
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