Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
27ac0d1f
Commit
27ac0d1f
authored
Jan 15, 2001
by
Ka-Ping Yee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better format names and error messages
parent
20579706
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
Lib/test/output/test_linuxaudiodev
Lib/test/output/test_linuxaudiodev
+2
-2
Modules/linuxaudiodev.c
Modules/linuxaudiodev.c
+12
-13
No files found.
Lib/test/output/test_linuxaudiodev
View file @
27ac0d1f
...
...
@@ -3,5 +3,5 @@ expected rate >= 0, not -1
expected sample size >= 0, not -2
nchannels must be 1 or 2, not 3
unknown audio encoding: 177
sample size 16 expected for Little-endian 16-bit unsigned audio: 8 received
sample size 8 expected for Standard unsigned 8-bit audio: 16 received
for linear unsigned 16-bit little-endian audio, expected sample size 16, not 8
for linear unsigned 8-bit audio, expected sample size 8, not 16
Modules/linuxaudiodev.c
View file @
27ac0d1f
...
...
@@ -63,15 +63,14 @@ static struct {
uint32_t
a_fmt
;
char
*
a_name
;
}
audio_types
[]
=
{
{
8
,
AFMT_MU_LAW
,
"Logarithmic mu-law audio"
},
{
8
,
AFMT_A_LAW
,
"Logarithmic A-law audio"
},
{
8
,
AFMT_U8
,
"Standard unsigned 8-bit audio"
},
{
8
,
AFMT_S8
,
"Standard signed 8-bit audio"
},
{
16
,
AFMT_U16_BE
,
"Big-endian 16-bit unsigned audio"
},
{
16
,
AFMT_U16_LE
,
"Little-endian 16-bit unsigned audio"
},
{
16
,
AFMT_S16_BE
,
"Big-endian 16-bit signed audio"
},
{
16
,
AFMT_S16_LE
,
"Little-endian 16-bit signed audio"
},
{
16
,
AFMT_S16_NE
,
"Native-endian 16-bit signed audio"
},
{
8
,
AFMT_MU_LAW
,
"logarithmic mu-law 8-bit audio"
},
{
8
,
AFMT_A_LAW
,
"logarithmic A-law 8-bit audio"
},
{
8
,
AFMT_U8
,
"linear unsigned 8-bit audio"
},
{
8
,
AFMT_S8
,
"linear signed 8-bit audio"
},
{
16
,
AFMT_U16_BE
,
"linear unsigned 16-bit big-endian audio"
},
{
16
,
AFMT_U16_LE
,
"linear unsigned 16-bit little-endian audio"
},
{
16
,
AFMT_S16_BE
,
"linear signed 16-bit big-endian audio"
},
{
16
,
AFMT_S16_LE
,
"linear signed 16-bit little-endian audio"
},
};
static
int
n_audio_types
=
sizeof
(
audio_types
)
/
sizeof
(
audio_types
[
0
]);
...
...
@@ -95,7 +94,7 @@ newladobject(PyObject *arg)
else
if
(
strcmp
(
mode
,
"w"
)
==
0
)
imode
=
O_WRONLY
;
else
{
PyErr_SetString
(
LinuxAudioError
,
"
Mode should be one of 'r',
or 'w'"
);
PyErr_SetString
(
LinuxAudioError
,
"
mode should be 'r'
or 'w'"
);
return
NULL
;
}
...
...
@@ -256,15 +255,15 @@ lad_setparameters(lad_t *self, PyObject *args)
}
if
(
audio_types
[
n
].
a_bps
!=
ssize
)
{
PyErr_Format
(
PyExc_ValueError
,
"
sample size %d expected for %s: %d receive
d"
,
audio_types
[
n
].
a_
bps
,
audio_types
[
n
].
a_name
,
ssize
);
"
for %s, expected sample size %d, not %
d"
,
audio_types
[
n
].
a_
name
,
audio_types
[
n
].
a_bps
,
ssize
);
return
NULL
;
}
if
(
emulate
==
0
)
{
if
((
self
->
x_afmts
&
audio_types
[
n
].
a_fmt
)
==
0
)
{
PyErr_Format
(
PyExc_ValueError
,
"
format not supported by device: %s
"
,
"
%s format not supported by device
"
,
audio_types
[
n
].
a_name
);
return
NULL
;
}
...
...
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