Almost all functions work on 16 bit stereo PCM. Some functions require signed input to work properly. All functions allow to change PCM sign. Functions that require signed input perform a double sign change operation which allow to have any kind of input PCM.
Internaly PCM are read as 32bit integer. This implies that buffer must be properly aligned (depending on the architecture). Left channel is stored the less signifiant 16 bit and right the most signifiant 16 bit. Ensure the audio device use the same byte order.
Constants for PCM sign transformation. | |
#define | MIXER68_SAME_SIGN 0x00000000 |
No channel. | |
#define | MIXER68_CHANGE_LEFT_CHANNEL_SIGN 0x00008000 |
Left channel. | |
#define | MIXER68_CHANGE_RIGHT_CHANNEL_SIGN 0x80000000 |
Right channel. | |
#define | MIXER68_CHANGE_SIGN 0x80008000 |
Both channels. | |
Functions | |
void | SC68mixer_stereo_16_LR (u32 *dest, u32 *src, int nb, const u32 sign) |
Copy 16-bit-stereo PCM with optionnal sign change. | |
void | SC68mixer_stereo_16_RL (u32 *dest, u32 *src, int nb, const u32 sign) |
Copy 16-bit-stereo PCM with channel swapping and optionnal sign change. | |
void | SC68mixer_stereo_FL_LR (float *dest, u32 *src, int nb, const u32 sign, const float norm) |
Copy 16-bit-stereo PCM into normalized float-stereo (-norm. | |
void | SC68mixer_dup_L_to_R (u32 *dest, u32 *src, int nb, const u32 sign) |
Copy left channel of 16-bit stereo PCM into L/R channels with optionnal sign change. | |
void | SC68mixer_dup_R_to_L (u32 *dest, u32 *src, int nb, const u32 sign) |
Copy right channel of 16-bit stereo PCM into L/R channels with optionnal sign change. | |
void | SC68mixer_blend_LR (u32 *dest, u32 *src, int nb, int factor, const u32 sign_r, const u32 sign_w) |
Copy 16-bit-stereo PCM with L/R blending and optionnal sign change. | |
void | SC68mixer_mult_LR (u32 *dest, u32 *src, int nb, const int ml, const int mr, const u32 sign_r, const u32 sign_w) |
Copy 16-bit-stereo PCM with L/R amplitude factor and optionnal sign change. | |
void | SC68mixer_fill (u32 *dest, int nb, const u32 sign) |
Fill 16-bit-stereo buffer with sign value (RRRRLLLL). |
Copy 16-bit-stereo PCM with optionnal sign change.
dest | Destination PCM buffer | |
src | Source PCM buffer (can be same as dest). | |
nb | Number of PCM | |
sign | Sign transformation. |
Copy 16-bit-stereo PCM with channel swapping and optionnal sign change.
dest | Destination PCM buffer | |
src | Source PCM buffer (can be same as dest). | |
nb | Number of PCM | |
sign | Sign transformation. |
Copy 16-bit-stereo PCM into normalized float-stereo (-norm.
.+norm).
dest | Destination PCM buffer | |
src | Source PCM buffer (can be same as dest). | |
nb | Number of PCM | |
sign | Sign transformation. | |
norm | float absolute range (normalization). |
Copy left channel of 16-bit stereo PCM into L/R channels with optionnal sign change.
dest | Destination PCM buffer | |
src | Source PCM buffer (can be same as dest). | |
nb | Number of PCM | |
sign | Sign transformation. |
Copy right channel of 16-bit stereo PCM into L/R channels with optionnal sign change.
dest | Destination PCM buffer | |
src | Source PCM buffer (can be same as dest). | |
nb | Number of PCM | |
sign | Sign transformation. |
void SC68mixer_blend_LR | ( | u32 * | dest, | |
u32 * | src, | |||
int | nb, | |||
int | factor, | |||
const u32 | sign_r, | |||
const u32 | sign_w | |||
) |
Copy 16-bit-stereo PCM with L/R blending and optionnal sign change.
This function performs following transformations in this order :
dest | Destination PCM buffer | |
src | Source PCM buffer (can be same as dest). | |
nb | Number of PCM | |
factor | Blending factor from [0..65536].
| |
sign_r | sign transform for input PCM. | |
sign_w | sign transform for output PCM. |
void SC68mixer_mult_LR | ( | u32 * | dest, | |
u32 * | src, | |||
int | nb, | |||
const int | ml, | |||
const int | mr, | |||
const u32 | sign_r, | |||
const u32 | sign_w | |||
) |
Copy 16-bit-stereo PCM with L/R amplitude factor and optionnal sign change.
This function performs following transformations in this order :
dest | Destination PCM buffer | |
src | Source PCM buffer (can be same as dest). | |
nb | Number of PCM | |
ml | Left channel factor from [-65536..65536]. | |
mr | Like ml but for right channel. | |
sign_r | sign transform for input PCM. | |
sign_w | sign transform for output PCM. |
Fill 16-bit-stereo buffer with sign value (RRRRLLLL).
dest | Destination PCM buffer | |
nb | Number of PCM | |
sign | PCM value written (right channel is MSW). |