#include <sent/stddefs.h>
#include <sent/adin.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
#include <sys/soundcard.h>
Include dependency graph for adin_mic_linux_oss.c:
Go to the source code of this file.
Defines | |
#define | DEFAULT_DEVICE "/dev/dsp" |
Default device name, can be overridden by AUDIODEV environment variable. | |
#define | FREQALLOWRANGE 200 |
Acceptable width of sampling frequency. | |
#define | MAXPOLLINTERVAL 300 |
Read timeout in msec. | |
#define | FRAGMENT_POWER 10 |
Functions | |
boolean | adin_mic_standby (int sfreq, void *dummy) |
boolean | adin_mic_start () |
boolean | adin_mic_stop () |
int | adin_mic_read (SP16 *buf, int sampnum) |
Read samples from the daemon. | |
Variables | |
static int | audio_fd |
Audio descriptor. | |
static boolean | need_swap |
Whether samples need byte swap. | |
static int | frag_size |
Actual data fragment size. | |
static boolean | stereo_rec |
TRUE if stereo recording (use left only). |
This OSS API is used by default on Linux machines. If you want another API (like ALSA native, esd, portaudio, spAudio), please specify "--with-mictype=TYPE" options at compilation time to configure script.
Sound card should support 16bit monaural recording. On Linux, however, if you unfortunately have a device with only stereo recording support, Julius will try to get input from the left channel of the stereo input.
Julius does not alter any mixer device setting at all on Linux. You should configure the mixer for recording source (mic/line) and recording volume correctly using other audio tool such as xmixer.
The default device name is "/dev/dsp", which can be changed by setting environment variable AUDIODEV.
Definition in file adin_mic_linux_oss.c.
|
Data fragment size. Input will be delayed by 2^X bytes. The default value of 10 means we treat input per a unit of 2~10=1024 bytes, which corresponds to 32 msec in 16kHz sampling. Definition at line 86 of file adin_mic_linux_oss.c. Referenced by adin_mic_standby(). |
|
Device initialization: check device capability and open for recording.
Definition at line 102 of file adin_mic_linux_oss.c. |
|
Start recording.
Definition at line 298 of file adin_mic_linux_oss.c. |
|
Stop recording.
Definition at line 318 of file adin_mic_linux_oss.c. |
|
Read samples from the daemon. Try to read sampnum samples and returns actual number of recorded samples currently available. This function will block at most MAXPOLLINTERVAL msec, until at least one sample can be obtained. If no data has been obtained after waiting for MAXPOLLINTERVAL msec, returns 0. When stereo input, only left channel will be used.
Definition at line 347 of file adin_mic_linux_oss.c. |