#include <sent/stddefs.h>
#include <sent/adin.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <poll.h>
#include <sys/soundcard.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 | POLLINTERVAL 200 |
Polling interval in miliseconds. | |
Functions | |
boolean | adin_mic_standby (int sfreq, void *arg) |
Device initialization: check device capability and open for recording. | |
boolean | adin_mic_begin () |
Start recording. | |
boolean | adin_mic_end () |
Stop recording. | |
int | adin_mic_read (SP16 *buf, int sampnum) |
Read samples from device. | |
Variables | |
static int | audio_fd |
Audio descriptor. | |
static boolean | need_swap |
Whether input samples need byte-swapping. | |
pollfd | fds [1] |
Workarea for polling device. |
Low level I/O functions for microphone input on FreeBSD.
To use microphone input in FreeBSD, sound card and sound driver must support 16bit monaural recording.
Julius does not alter any mixer device setting at all. You should configure the mixer for recording source (mic/line) and recording volume correctly using other audio tool.
The default device name is "/dev/dsp", which can be changed by setting environment variable AUDIODEV.
Tested on FreeBSD 3.2-RELEASE with snd driver.
Definition in file adin_mic_freebsd.c.
boolean adin_mic_standby | ( | int | sfreq, | |
void * | arg | |||
) |
Device initialization: check device capability and open for recording.
sfreq | [in] required sampling frequency. | |
arg | [in] a dummy data |
Definition at line 90 of file adin_mic_freebsd.c.
boolean adin_mic_begin | ( | ) |
Start recording.
Definition at line 199 of file adin_mic_freebsd.c.
boolean adin_mic_end | ( | ) |
Stop recording.
Definition at line 210 of file adin_mic_freebsd.c.
int adin_mic_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 until at least one sample can be obtained.
buf | [out] samples obtained in this function | |
sampnum | [in] wanted number of samples to be read |
Definition at line 234 of file adin_mic_freebsd.c.