libsent/src/adin/adin_mic_freebsd.c File Reference

Microphone input on FreeBSD. More...

#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 <machine/soundcard.h>

Include dependency graph for adin_mic_freebsd.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 POLLINTERVAL   200
 Polling interval in miliseconds.

Functions

boolean adin_mic_standby (int sfreq, void *arg)
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 input samples need byte-swapping.
pollfd fds [1]
 Workarea for polling device.


Detailed Description

Microphone input on FreeBSD.

Author:
Akinobu LEE
Date:
Sun Feb 13 16:18:26 2005
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.

Revision
1.3

Definition in file adin_mic_freebsd.c.


Function Documentation

boolean adin_mic_standby ( int  sfreq,
void *  arg 
)

Device initialization: check device capability and open for recording.

Parameters:
sfreq [in] required sampling frequency.
arg [in] a dummy data
Returns:
TRUE on success, FALSE on failure.

Definition at line 85 of file adin_mic_freebsd.c.

boolean adin_mic_start (  ) 

Start recording.

Returns:
TRUE on success, FALSE on failure.

Definition at line 191 of file adin_mic_freebsd.c.

boolean adin_mic_stop (  ) 

Stop recording.

Returns:
TRUE on success, FALSE on failure.

Definition at line 207 of file adin_mic_freebsd.c.

int adin_mic_read ( SP16 buf,
int  sampnum 
)

Read samples from the daemon.

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.

Parameters:
buf [out] samples obtained in this function
sampnum [in] wanted number of samples to be read
Returns:
actural number of read samples, -2 if error.

Definition at line 231 of file adin_mic_freebsd.c.


Generated on Tue Dec 26 16:17:35 2006 for Julius by  doxygen 1.5.0