aResample.3p
1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.TH aResample 3P local "Silicon Graphics, Inc."
.SH NAME
aResample \- Audio resampling and envelope modulation command
.SH C SPECIFICATION
#include "mbi.h"
.br
.sp
.nf
typedef struct {
short volume;
short pitch;
} RESAMPLE_STATE;
.fi
.sp
aResample(Acmd *pkt, unsigned char flags, short pitch, RESAMPLE_STATE *state)
.SH PARAMETERS
.TP 10
.I pkt
Audio command list pointer.
.TP
.I flags
Set of flags to define behaviour of the resampling command:
\f2A_MIX\f1, result is mixed into the output buffer.
If not set the result is put into the output buffer.
\f2A_INIT\f1, state is ignored when initiating resampling.
If not set the pointer to state is used to initialize the resampler.
.TP
.I pitch
Resampling pitch.
.TP
.I state
Pointer to Resampler state in DRAM.
.SH DESCRIPTION
.IR aResample
pitch shifts and envelope modulates a stream in DMEM. Input
and output are 16 bit 2's complement audio samples.
Input and output
and number of samples to process are set by a call to
.IR SetBuffer().
The volume envelope is set by a call to
.IR aSetVolume().
The command operates
on vectors of 8 samples.
If the number of samples, defined through the
.IR aSetBuffer()
.IR count
parameter, is not a multiple of 8 the command
will produce the smallest multiple of 8 which is greater than count, however,
the state saved to DRAM will reflect the value at the start of the
last block of 8, so that a future call with this state will allow the
last block to be reproduced.
This is used to implement processing of arbitrary length streams, without
the need to save leftover samples.