#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>
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 | MAX_FRAGMENT_MSEC 50 |
Maximum Data fragment Length in msec. | |
#define | MIN_FRAGMENT_SIZE 256 |
Minimum fragment length in bytes. | |
Functions | |
boolean | adin_oss_standby (int sfreq, void *dummy) |
Device initialization: check device capability and open for recording. | |
boolean | adin_oss_begin () |
Start recording. | |
boolean | adin_oss_end () |
Stop recording. | |
int | adin_oss_read (SP16 *buf, int sampnum) |
Read samples from device. | |
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). |
Low level I/O functions for microphone input on Linux using OSS API. Works on kernel driver, OSS/Linux, ALSA OSS compatible device, and other OSS compatible drivers. This will work on kernel 2.0.x and later.
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.
#define MAX_FRAGMENT_MSEC 50 |
Maximum Data fragment Length in msec.
Input can be delayed to this time. a maximum of 2^x number smaller than this value will be taken. You can override this value by specifying environment valuable "LATENCY_MSEC".
Definition at line 94 of file adin_mic_linux_oss.c.
Referenced by adin_mic_standby(), and adin_oss_standby().
boolean adin_oss_standby | ( | int | sfreq, | |
void * | dummy | |||
) |
Device initialization: check device capability and open for recording.
sfreq | [in] required sampling frequency. | |
dummy | [in] a dummy data |
Definition at line 115 of file adin_mic_linux_oss.c.
Referenced by adin_mic_standby(), and adin_select().
boolean adin_oss_begin | ( | ) |
Start recording.
Definition at line 348 of file adin_mic_linux_oss.c.
Referenced by adin_mic_begin(), and adin_select().
boolean adin_oss_end | ( | ) |
Stop recording.
Definition at line 367 of file adin_mic_linux_oss.c.
Referenced by adin_mic_end(), and adin_select().
int adin_oss_read | ( | SP16 * | buf, | |
int | sampnum | |||
) |
Read samples from device.
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.
buf | [out] samples obtained in this function | |
sampnum | [in] wanted number of samples to be read |
Definition at line 396 of file adin_mic_linux_oss.c.
Referenced by adin_mic_read(), and adin_select().