Common Lisp Package: MIXALOT

README:

FUNCTION

Public

ADD-STEREO-SAMPLES (X Y)

Add two stereo samples, without clipping.

CREATE-MIXER (&KEY (RATE 44100) (CONSTRUCTOR 'MAKE-MIXER))

Create a new mixer at the specified sample rate, running in its own thread.

MIX-STEREO-SAMPLES (X Y)

Mix two stereo samples by clamped addition

MIXER-CURRENT-TIME (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

MIXER-RATE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

MIXER-SHUTDOWN-FLAG (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

MIXER-STREAM-LIST (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

MIXER-STREAM-LOCK (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

Undocumented

%STEREO-LEFT (SAMPLE)

%STEREO-RIGHT (SAMPLE)

CLAMP-SAMPLE (X)

CLAMP-SAMPLE+ (X Y)

DESTROY-MIXER (MIXER)

MAIN-THREAD-INIT

MAKE-FAST-VECTOR-STREAMER-INTERLEAVED-STEREO (VECTOR &OPTIONAL (START 0) (END (LENGTH VECTOR)))

MAKE-FAST-VECTOR-STREAMER-JOINT-STEREO (VECTOR &OPTIONAL (START 0) (END (LENGTH VECTOR)))

MAKE-FAST-VECTOR-STREAMER-MONO (VECTOR &OPTIONAL (START 0) (END (LENGTH VECTOR)))

MAKE-TEST-STREAMER

MAKE-VECTOR-STREAMER-INTERLEAVED-STEREO (VECTOR &OPTIONAL (START 0) (END (LENGTH VECTOR)))

MAKE-VECTOR-STREAMER-JOINT-STEREO (VECTOR &OPTIONAL (START 0) (END (LENGTH VECTOR)))

MAKE-VECTOR-STREAMER-MONO (VECTOR &OPTIONAL (START 0) (END (LENGTH VECTOR)))

MAKE-VECTOR-STREAMER-MONO-DOUBLE-FLOAT (VECTOR &OPTIONAL (START 0) (END (LENGTH VECTOR)))

MAKE-VECTOR-STREAMER-MONO-SINGLE-FLOAT (VECTOR &OPTIONAL (START 0) (END (LENGTH VECTOR)))

MIXER-ADD-STREAMER (MIXER STREAMER)

SETFMIXER-CURRENT-TIME (NEW-VALUE INSTANCE)

SETFMIXER-RATE (NEW-VALUE INSTANCE)

MIXER-REMOVE-ALL-STREAMERS (MIXER)

SETFMIXER-SHUTDOWN-FLAG (NEW-VALUE INSTANCE)

SETFMIXER-STREAM-LIST (NEW-VALUE INSTANCE)

SETFMIXER-STREAM-LOCK (NEW-VALUE INSTANCE)

MONO->STEREO (SAMPLE)

SPLIT-SAMPLE (SAMPLE)

STEREO->MONO (SAMPLE)

STEREO-LEFT (SAMPLE)

STEREO-RIGHT (SAMPLE)

STEREO-SAMPLE (LEFT RIGHT)

Private

MIXER-DEVICE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

MIXER-STREAM-STATE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

Undocumented

%REQ-REMOVE-STREAMER (MIXER STREAMER)

%SND-PCM-OPEN (PCM NAME TYPE MODE)

%VAR-ACCESSOR-STDOUT

SETF%VAR-ACCESSOR-STDOUT (VALUE)

CALL-WITH-PCM (RATE CONTINUATION)

CHECK-ERROR (CIRCUMSTANCE RESULT)

COPY-MIXER (INSTANCE)

DUMP-PCM-INFO (PCM)

MAKE-MIXER (&KEY ((STREAM-LOCK DUM396) (MAKE-LOCK Mixer lock)) ((STREAM-LIST DUM397) NIL) ((CURRENT-TIME DUM398) 0) ((RATE DUM399) 44100) ((SHUTDOWN-FLAG DUM400) NIL) ((STREAM-STATE DUM401) (MAKE-HASH-TABLE)) ((DEVICE DUM402) NIL))

SETFMIXER-DEVICE (NEW-VALUE INSTANCE)

MIXER-P (OBJECT)

SETFMIXER-STREAM-STATE (NEW-VALUE INSTANCE)

REMOVE-REMOVABLE (MIXER TEMP-VECTOR)

RUN-MIXER-PROCESS (MIXER)

SCALE-SAMPLE (X Y)

SCALE-STEREO-SAMPLE (STEREO SCALE)

SIGN-EXTEND-16 (X)

SND-OUTPUT-STDIO-ATTACH (OUTPUTP FILE CLOSE)

SND-PCM-CLOSE (PCM)

SND-PCM-DUMP (PCM OUT)

SND-PCM-OPEN (NAME STREAM-TYPE MODE)

SND-PCM-RECOVER (PCM ERR SILENT)

SND-PCM-SET-PARAMS (PCM FORMAT ACCESS CHANNELS RATE SOFT-RESAMPLE LATENCY)

SND-PCM-WRITEI (PCM BUFFER SIZE)

SND-STRERROR (ERRNUM)

UPDATE-PLAYABLE (MIXER PLAYABLE-STREAMS)

VECTOR-STREAM-DO-SEEK (STREAM)

MACRO

Public

Undocumented

STEREO-INCF (PLACE SAMPLE &ENVIRONMENT ENV)

STEREO-MIXF (PLACE SAMPLE &ENVIRONMENT ENV)

WITH-ARRAY-POINTER ((NAME ARRAY) &BODY BODY)

Private

Undocumented

DEFINE-VECTOR-STREAMER (NAME &KEY TYPE STEP SAMPLE-EXPR OPTIMIZE)

META-VECTOR-STREAMER (VSTREAMER MODIFIER TYPE STEP SAMPLE-EXPR)

WITH-MIXER-LOCK ((MIXER) &BODY BODY)

GENERIC-FUNCTION

Public

STREAMER-CLEANUP (STREAM MIXER)

Release resources and perform any other cleanups needed when a streamer is destroyed as a result of a call to mixer-remove-streamer. Called outside the mixer lock, so it's okay to manipulate the mixer.

STREAMER-LENGTH (STREAM MIXER)

Returns length, in samples, of the audio stream, or NIL if it cannot be determined.

STREAMER-MIX-INTO (STREAM MIXER BUFFER OFFSET LENGTH TIME)

Mix 'length' samples of stream output into buffer starting at 'offset' measured in samples, at 'time' (measured in samples since the mixer was created. The time measurement includes the offset, and is intended for synchronizing streams. Called from outside the mixer lock.

STREAMER-PAUSE (STREAM MIXER)

Pause playback of the streamer. A method on streamer-pause is optional and serves as a notification to the streamer that it has been paused; the default method is specialized on the mixer and can suspend playback without any special support from the streamer.

STREAMER-PAUSED-P (STREAM MIXER)

Query whether a stream is paused or not.

STREAMER-POSITION (STREAM MIXER)

Returns current position within a seekable stream.

STREAMER-SEEK (STREAM MIXER POSITION &ALLOW-OTHER-KEYS)

Seek to position (measured in samples) from the start of stream.

STREAMER-SEEKABLE-P (STREAM MIXER)

Returns non-NIL if the streamer supports seeking.

STREAMER-UNPAUSE (STREAM MIXER)

Unpause playback of the streamer. A method on streamer-unpause is optional and serves as a notification to the streamer that it has been unpaused; the default method is specialized on the mixer and can resume playback without any special support from the streamer.

STREAMER-WRITE-INTO (STREAM MIXER BUFFER OFFSET LENGTH TIME)

Write 'length' samples of stream output into buffer starting at 'offset' (measured in samples), at 'time' (measured in samples since the mixer was created. The time measurement includes the offset, and is intended for synchronizing streams. The differs from stream-write-info in that you don't have to mix the data, the current contents are expected to be garbage and can be overwritten. Implementing this is optional. Called from outside the mixer lock.

Undocumented

MIXER-NOTE-WRITE (MIXER BUFFER OFFSET SIZE)

MIXER-REMOVE-STREAMER (MIXER STREAMER)

SLOT-ACCESSOR

Private

Undocumented

ELTS-PER-SAMPLE (OBJECT)

END (OBJECT)

POSITION-OF (OBJECT)

SEEK-TO (OBJECT)

SETFSEEK-TO (NEW-VALUE OBJECT)

START (OBJECT)

VECTOR-OF (OBJECT)

CLASS

Public

Undocumented

FAST-VECTOR-STREAMER-INTERLEAVED-STEREO

FAST-VECTOR-STREAMER-JOINT-STEREO

FAST-VECTOR-STREAMER-MONO

MIXER

VECTOR-STREAMER

VECTOR-STREAMER-INTERLEAVED-STEREO

VECTOR-STREAMER-JOINT-STEREO

VECTOR-STREAMER-MONO

VECTOR-STREAMER-MONO-DOUBLE-FLOAT

VECTOR-STREAMER-MONO-SINGLE-FLOAT

CONDITION

Public

ALSA-ERROR

An error from the ALSA library

CONSTANT

Private

Undocumented

+MIXER-BUFFER-SIZE+