-
Notifications
You must be signed in to change notification settings - Fork 7
/
wavplay.3
75 lines (70 loc) · 2.39 KB
/
wavplay.3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" Man page generated from reStructeredText.
.
.TH WAVPLAY 3 "2011-11-02" "0.4" ""
.SH NAME
wavplay \- a C library to play wave audio files
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH SYNOPSIS
.nf
\fB#include "wavplay.h"\fP
\fIint\fP
\fBwav_play\fP(\fIconst\fP \fIchar\fP \fI*\fP \fIfilename\fP);
\fIint\fP
\fBwav_send\fP(\fIFILE\fP \fI*\fP \fIstream\fP);
\fIint\fP
\fBsnd_init\fP(\fIvoid\fP);
\fIint\fP
\fBsnd_end\fP(\fIvoid\fP);
\fIint\fP
\fBsnd_drop\fP(\fIvoid\fP);
.fi
.sp
.SH DESCRIPTION
.sp
The \fBsnd_init()\fP initializes the sound device. Until the \fBsnd_end()\fP function is called or the program is quit, the device reminds open. The \fBsnd_drop()\fP function stops the device from playing.
.sp
The \fBwav_play()\fP function opens and plays a wave audio file, and the \fBwav_send()\fP function plays a wave audio data stream. The sound device will be set according to the sampling format.
.sp
If the macro \fBUSE_ALSA\fP is defined, ALSA is used instead of OSS as the backend. The default OSS device is \fI/dev/dsp\fP, and the default ALSA PCM name is \fIdefault\fP. They are defined by the macro \fBDEV_NAME\fP.
.SH RETURN VALUES
.sp
The \fBsnd_init()\fP, \fBsnd_end()\fP, and \fBsnd_drop()\fP functions return a non\-negative integer if successful. The actual value is different for OSS/ALSA.
.sp
The \fBwav_play()\fP and \fBwav_send()\fP functions return the value 0 if the sound data was sent to the device; otherwise the value \-1 is returned.
.SH SUPPORTED FORMATS
.sp
WAV (+extensible), AIFF/AIFC (+sowt), Sun Au, with 8/16/24/32 bits PCM or A\-law, mu\-law audios, are fully supported. IMA ADPCM in WAV or AIFF is also supported.
The playback support depends on the OSS/ALSA drivers and the soundcard.
.SH AUTHOR
Zhihao Yuan <[email protected]>
.SH COPYRIGHT
2-clause BSD License
.\" Generated by docutils manpage writer.
.\"
.