| 1 |
/* |
| 2 |
Realtime Audio I/O module from <csound.h> |
| 3 |
https://csound.com/docs/api/modules.html |
| 4 |
*/ |
| 5 |
|
| 6 |
/** |
| 7 |
* Returns the number of samples in Csound's input buffer. |
| 8 |
* @async |
| 9 |
* @function |
| 10 |
* @name getInputBufferSize |
| 11 |
* @memberof CsoundObj |
| 12 |
* @return {Promise.<number>} |
| 13 |
*/ |
| 14 |
export const csoundGetInputBufferSize = (wasm) => (csound) => |
| 15 |
wasm.exports.csoundGetInputBufferSize(csound); |
| 16 |
|
| 17 |
csoundGetInputBufferSize.toString = () => "getInputBufferSize = async () => Number;"; |
| 18 |
|
| 19 |
/** |
| 20 |
* Returns the number of samples in Csound's output buffer. |
| 21 |
* @async |
| 22 |
* @function |
| 23 |
* @name getOutputBufferSize |
| 24 |
* @memberof CsoundObj |
| 25 |
* @return {Promise.<number>} |
| 26 |
*/ |
| 27 |
export const csoundGetOutputBufferSize = (wasm) => (csound) => |
| 28 |
wasm.exports.csoundGetOutputBufferSize(csound); |
| 29 |
|
| 30 |
csoundGetOutputBufferSize.toString = () => "getOutputBufferSize = async () => Number;"; |
| 31 |
|
| 32 |
/** |
| 33 |
* Returns the address of the Csound audio input buffer. |
| 34 |
* @function |
| 35 |
*/ |
| 36 |
export const csoundGetInputBuffer = (wasm /* WasmInst */) => (csound /* CsoundInst */) => |
| 37 |
wasm.exports.csoundGetInputBuffer(csound); |
| 38 |
|
| 39 |
csoundGetInputBuffer.toString = () => "getInputBuffer = async () => Number;"; |
| 40 |
|
| 41 |
/** |
| 42 |
* Returns the address of the Csound audio output buffer. |
| 43 |
* @function |
| 44 |
*/ |
| 45 |
export const csoundGetOutputBuffer = (wasm /* WasmInst */) => (csound /* CsoundInst */) => |
| 46 |
wasm.exports.csoundGetOutputBuffer(csound); |
| 47 |
|
| 48 |
csoundGetOutputBuffer.toString = () => "getOutputBuffer = async () => Number;"; |
| 49 |
|
| 50 |
/** |
| 51 |
* Returns the address of the Csound audio input working buffer (spin). |
| 52 |
* Enables external software to write audio into Csound before calling csoundPerformKsmps. |
| 53 |
* @function |
| 54 |
*/ |
| 55 |
export const csoundGetSpin = (wasm /* WasmInst */) => (csound /* CsoundInst */) => |
| 56 |
wasm.exports.csoundGetSpin(csound); |
| 57 |
|
| 58 |
csoundGetSpin.toString = () => "getSpin = async (csound) => Number;"; |
| 59 |
|
| 60 |
/** |
| 61 |
* Returns the address of the Csound audio output working buffer (spout). |
| 62 |
* Enables external software to read audio from Csound after calling csoundPerformKsmps. |
| 63 |
* @function |
| 64 |
*/ |
| 65 |
export const csoundGetSpout = (wasm /* WasmInst */) => (csound /* CsoundInst */) => |
| 66 |
wasm.exports.csoundGetSpout(csound); |
| 67 |
|
| 68 |
csoundGetSpout.toString = () => "getSpout = async () => Number;"; |
| 69 |
|
| 70 |
// PUBLIC void csoundSetRTAudioModule (CSOUND *csound, const char *module) |
| 71 |
// PUBLIC int csoundGetModule (CSOUND *csound, int number, char **name, char **type) |
| 72 |
|
| 73 |
// PUBLIC void csoundClearSpin (CSOUND *) |
| 74 |
// PUBLIC void csoundAddSpinSample (CSOUND *csound, int frame, int channel, MYFLT sample) |
| 75 |
// PUBLIC void csoundSetSpinSample (CSOUND *csound, int frame, int channel, MYFLT sample) |
| 76 |
|
| 77 |
// PUBLIC MYFLT csoundGetSpoutSample (CSOUND *csound, int frame, int channel) |
| 78 |
// PUBLIC void ** csoundGetRtRecordUserData (CSOUND *) |
| 79 |
// PUBLIC void ** csoundGetRtPlayUserData (CSOUND *) |
| 80 |
// PUBLIC void csoundSetHostImplementedAudioIO (CSOUND *, int state, int bufSize) |
| 81 |
// PUBLIC int csoundGetAudioDevList (CSOUND *csound, CS_AUDIODEVICE *list, int isOutput) |
| 82 |
// PUBLIC void csoundSetPlayopenCallback (CSOUND *, int(*playopen__)(CSOUND *, const csRtAudioParams *parm)) |
| 83 |
// PUBLIC void csoundSetRtplayCallback (CSOUND *, void(*rtplay__)(CSOUND *, const MYFLT *outBuf, int nbytes)) |
| 84 |
// PUBLIC void csoundSetRecopenCallback (CSOUND *, int(*recopen_)(CSOUND *, const csRtAudioParams *parm)) |
| 85 |
// PUBLIC void csoundSetRtrecordCallback (CSOUND *, int(*rtrecord__)(CSOUND *, MYFLT *inBuf, int nbytes)) |
| 86 |
// PUBLIC void csoundSetRtcloseCallback (CSOUND *, void(*rtclose__)(CSOUND *)) |
| 87 |
// PUBLIC void csoundSetAudioDeviceListCallback (CSOUND *csound, int(*audiodevlist__)(CSOUND *, CS_AUDIODEVICE *list, int isOutput)) |