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
7487c022
Kaydet (Commit)
7487c022
authored
Haz 17, 1999
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Small markup and English usage nits.
üst
bfadac00
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
29 deletions
+30
-29
libwave.tex
Doc/lib/libwave.tex
+30
-29
No files found.
Doc/lib/libwave.tex
Dosyayı görüntüle @
7487c022
% Documentations stolen and LaTeX'ed from comments in file.
\section
{
\module
{
wave
}
---
Read and write
.
WAV files
}
Read and write WAV files
}
\declaremodule
{
standard
}{
wave
}
\sectionauthor
{
Moshe Zadka
}{
mzadka@geocities.com
}
...
...
@@ -10,7 +10,7 @@ The \module{wave} module provides a convenient interface to the WAV sound
format. It does not support compression/decompression, but it does support
mono/stereo.
The
\module
{
wave
}
module defines the following function:
The
\module
{
wave
}
module defines the following function
and exception
:
\begin{funcdesc}
{
open
}{
file, mode
}
If
\var
{
file
}
is a string, open the file by that name, other treat it
...
...
@@ -38,11 +38,17 @@ WAV specification or hits an implementation deficiency.
\subsection
{
Wave
_
read Objects
\label
{
Wave-read-objects
}}
Wave
_
read objects, as returned by
\function
{
open()
}
above
, have the
Wave
_
read objects, as returned by
\function
{
open()
}
, have the
following methods:
\begin{methoddesc}
[Wave
_
read]
{
close
}{}
Close the stream, and make the instance unusable. This is
called automatically on object collection.
\end{methoddesc}
\begin{methoddesc}
[Wave
_
read]
{
getnchannels
}{}
Returns number of audio channels (1 for mone, 2 for stereo).
Returns number of audio channels (
\code
{
1
}
for mono,
\code
{
2
}
for
stereo).
\end{methoddesc}
\begin{methoddesc}
[Wave
_
read]
{
getsampwidth
}{}
...
...
@@ -68,8 +74,9 @@ Usually \code{'not compressed'} parallels \code{'NONE'}.
\begin{methoddesc}
[Wave
_
read]
{
getparams
}{}
Returns a tuple
\code
{
(nchannels, sampwidth, framerate, nframes, comptype, compname)
}
,
equivalent to output of the
\code
{
get
}
methods.
\code
{
(
\var
{
nchannels
}
,
\var
{
sampwidth
}
,
\var
{
framerate
}
,
\var
{
nframes
}
,
\var
{
comptype
}
,
\var
{
compname
}
)
}
, equivalent to output
of the
\method
{
get*()
}
methods.
\end{methoddesc}
\begin{methoddesc}
[Wave
_
read]
{
readframes
}{
n
}
...
...
@@ -80,7 +87,7 @@ Reads and returns at most \var{n} frames of audio, as a string of bytes.
Rewind the file pointer to the beginning of the audio stream.
\end{methoddesc}
The following two
function
s are defined for compatibility with the
The following two
method
s are defined for compatibility with the
\refmodule
{
aifc
}
module, and don't do anything interesting.
\begin{methoddesc}
[Wave
_
read]
{
getmarkers
}{}
...
...
@@ -102,32 +109,32 @@ Set the file pointer to the specified position.
Return current file pointer position.
\end{methoddesc}
\begin{methoddesc}
[Wave
_
read]
{
close
}{}
Close the stream, and make the instance unusable. (This is
called automatically on deletion.
\end{methoddesc}
\subsection
{
Wave
_
write Objects
\label
{
Wave-write-objects
}}
Wave
_
write objects, as returned by
\function
{
open()
}
above
, have the
Wave
_
write objects, as returned by
\function
{
open()
}
, have the
following methods:
\begin{methoddesc}
[Wave
_
write]
{
close
}{}
Make sure
\var
{
nframes
}
is correct, and close the file.
This method is called upon deletion.
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
setnchannels
}{
n
}
Set the number of channels.
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
setsampwidth
}{
n
}
Set the sample width
(in bytes.)
Set the sample width
to
\var
{
n
}
bytes.
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
setframerate
}{
n
}
Set the frame rate.
Set the frame rate
to
\var
{
n
}
.
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
setnframes
}{
n
}
Set the number of frames
. This can be later changed, when and if more
frames are written.
Set the number of frames
to
\var
{
n
}
. This will be changed later if
more
frames are written.
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
setcomptype
}{
type, name
}
...
...
@@ -135,15 +142,15 @@ Set the compression type and description.
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
setparams
}{
tuple
}
The
\var
{
tuple
}
should be
\code
{
(
\var
{
nchannels
}
,
\var
{
sampwidth
}
,
\var
{
framerate
}
,
\var
{
nframes
}
,
\var
{
comptype
}
,
\var
{
compname
}
)
}
, with values valid for
the
\code
{
set
}
methods. Set all parameters.
The
\var
{
tuple
}
should be
\code
{
(
\var
{
nchannels
}
,
\var
{
sampwidth
}
,
\var
{
framerate
}
,
\var
{
nframes
}
,
\var
{
comptype
}
,
\var
{
compname
}
)
}
, with
values valid for the
\method
{
set*()
}
methods. Sets all parameters.
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
tell
}{}
Return current position in the file, with the same disclaimer for
the
\method
{
Wave
_
read.tell
}
and
\method
{
Wave
_
read.setpos
}
methods.
the
\method
{
Wave
_
read.tell()
}
and
\method
{
Wave
_
read.setpos()
}
methods.
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
writeframesraw
}{
data
}
...
...
@@ -154,12 +161,6 @@ Write audio frames, without correcting \var{nframes}.
Write audio frames and make sure
\var
{
nframes
}
is correct.
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
close
}{}
Make sure
\var
{
nframes
}
is correct, and close the file.
This method is called upon deletion.
\end{methoddesc}
Note that it is invalid to set any parameters after calling
\method
{
writeframes()
}
or
\method
{
writeframesraw()
}
, and any attempt
to do so will raise
an error
.
to do so will raise
\exception
{
wave.Error
}
.
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