DSP Functions
Superpowered offers some general purpose efficient DSP functions to use throughout your projects. These include:
- Applying volume of an audio buffer (gain).
- Changing volume of an audio buffer with a smooth ramp.
- Mixing audio to existing audio in a buffer (with or without changing volume).
- Crossfading audio between two buffers.
- Getting the peak absolute audio sample value in a buffer.
- Converting 32-bit, 24-bit and 16-bit audio in floating point or signed integer formats.
- Interleaving or de-interleaving.
Please a look at the list of functions available to find the tool you need.
Add1
METHODAdds the values in input to the values in output: output[n] += input[n].ParametersReturnsName Type Description input Number (pointer in Linear Memory)
Input data. output Number (pointer in Linear Memory)
Output data. numberOfItems Number
The length of input. NoneAdd1
METHODAdds the values in input to the values in output: output[n] += input[n].ParametersReturnsName Type Default Description input float *
Input data. output float *
Output data. numberOfItems unsigned int
The length of input. NoneAdd2
METHODAdds the values in two inputs to the values in output: output[n] += inputA[n] + inputB[n].ParametersReturnsName Type Description inputA Number (pointer in Linear Memory)
Input data. inputB Number (pointer in Linear Memory)
Input data. output Number (pointer in Linear Memory)
Output data. numberOfItems Number
The length of input. NoneAdd2
METHODAdds the values in two inputs to the values in output: output[n] += inputA[n] + inputB[n].ParametersReturnsName Type Default Description inputA float *
Input data. inputB float *
Input data. output float *
Output data. numberOfItems unsigned int
The length of input. NoneAdd4
METHODAdds the values in four inputs to the values in output: output[n] += inputA[n] + inputB[n] + inputC[n] + inputD[n].ParametersReturnsName Type Description inputA Number (pointer in Linear Memory)
Input data. inputB Number (pointer in Linear Memory)
Input data. inputC Number (pointer in Linear Memory)
Input data. inputD Number (pointer in Linear Memory)
Input data. output Number (pointer in Linear Memory)
Output data. numberOfItems Number
The length of input. NoneAdd4
METHODAdds the values in four inputs to the values in output: output[n] += inputA[n] + inputB[n] + inputC[n] + inputD[n].ParametersReturnsName Type Default Description inputA float *
Input data. inputB float *
Input data. inputC float *
Input data. inputD float *
Input data. output float *
Output data. numberOfItems unsigned int
The length of input. NoneBit24ToFloat
METHODConverts 24-bit audio to 32-bit floating point.ParametersReturnsName Type Description input Number (pointer in Linear Memory)
24-bit input. output Number (pointer in Linear Memory)
32-bit output. numberOfFrames Number
The number of frames to process. numberOfChannels Number
The number of channels. NoneBit24ToFloat
METHODConverts 24-bit audio to 32-bit floating point.ParametersReturnsName Type Default Description input void *
24-bit input. output float *
32-bit output. numberOfFrames unsigned int
The number of frames to process. numberOfChannels unsigned int
2 The number of channels. NoneChangeVolume
METHODApplies volume on a single stereo interleaved buffer: output = input * gain.ParametersReturnsName Type Description input Number (pointer in Linear Memory)
32-bit interleaved stereo input. output Number (pointer in Linear Memory)
32-bit interleaved stereo output. Can be equal to input (in-place processing). volumeStart Number
Volume for the first frame. volumeChange Number
Change volume by this amount for every frame. numberOfFrames Number
Number of frames to process. NoneChangeVolume
METHODApplies volume on a single stereo interleaved buffer: output = input * gain.ParametersReturnsName Type Default Description input float *
32-bit interleaved stereo input. output float *
32-bit interleaved stereo output. Can be equal to input (in-place processing). volumeStart float
Volume for the first frame. volumeChange float
Change volume by this amount for every frame. numberOfFrames unsigned int
Number of frames to process. NoneChangeVolumeAdd
METHODApplies volume on a single stereo interleaved buffer and adds it to the audio in the output buffer: output = output + input * gain.ParametersReturnsName Type Description input Number (pointer in Linear Memory)
32-bit interleaved stereo input. output Number (pointer in Linear Memory)
32-bit interleaved stereo output. Can be equal to input (in-place processing). volumeStart Number
Volume for the first frame. volumeChange Number
Change volume by this amount for every frame. numberOfFrames Number
Number of frames to process. NoneChangeVolumeAdd
METHODApplies volume on a single stereo interleaved buffer and adds it to the audio in the output buffer: output = output + input * gain.ParametersReturnsName Type Default Description input float *
32-bit interleaved stereo input. output float *
32-bit interleaved stereo output. Can be equal to input (in-place processing). volumeStart float
Volume for the first frame. volumeChange float
Change volume by this amount for every frame. numberOfFrames Number
Number of frames to process. NoneCharToFloat
METHODConverts 8-bit audio to 32-bit floating point.ParametersReturnsName Type Description input Number (pointer in Linear Memory)
8-bit input. output Number (pointer in Linear Memory)
32-bit output. numberOfFrames Number
The number of frames to process. numberOfChannels Number
The number of channels. NoneCharToFloat
METHODConverts 8-bit audio to 32-bit floating point.ParametersReturnsName Type Default Description input signed char *
8-bit input. output float *
32-bit output. numberOfFrames unsigned int
The number of frames to process. numberOfChannels unsigned int
2 The number of channels. NoneCopyMonoFromInterleaved
METHODCopy mono audio from an interleaved buffer.ParametersReturnsName Type Description interleavedInput Number (pointer in Linear Memory)
Interleaved input. numInterleavedChannels Number
The total number of channels in the interleaved input. monoOutput Number (pointer in Linear Memory)
Mono output. channelIndex Number
Copy this channel. numberOfFrames Number
The number of frames to process. NoneCopyMonoFromInterleaved
METHODCopy mono audio from an interleaved buffer.ParametersReturnsName Type Default Description interleavedInput float *
Interleaved input. numInterleavedChannels unsigned int
The total number of channels in the interleaved input. monoOutput float *
Mono output. channelIndex unsigned int
Copy this channel. numberOfFrames unsigned int
The number of frames to process. NoneCopyMonoToInterleaved
METHODCopy a mono channel into an interleaved buffer.ParametersReturnsName Type Description monoInput Number (pointer in Linear Memory)
Mono input. channelIndex Number
Copy to this channel. interleavedOutput Number (pointer in Linear Memory)
Interleaved output. numInterleavedChannels Number
The total number of channels in the interleaved output. numberOfFrames Number
The number of frames to process. NoneCopyMonoToInterleaved
METHODCopy a mono channel into an interleaved buffer.ParametersReturnsName Type Default Description monoInput float *
Mono input. channelIndex unsigned int
Copy to this channel. interleavedOutput float *
Interleaved output. numInterleavedChannels unsigned int
The total number of channels in the interleaved output. numberOfFrames unsigned int
The number of frames to process. NoneCopyStereoFromInterleaved
METHODCopy stereo audio from an interleaved buffer.ParametersReturnsName Type Description interleavedInput Number (pointer in Linear Memory)
Interleaved input. numInterleavedChannels Number
The total number of channels in the interleaved input. stereoOutput Number (pointer in Linear Memory)
Stereo interleaved output. channelIndex Number
Copy this channel. channelIndex is the left side, channelIndex + 1 is the right side. numberOfFrames Number
The number of frames to process. NoneCopyStereoFromInterleaved
METHODCopy stereo audio from an interleaved buffer.ParametersReturnsName Type Default Description interleavedInput float *
Interleaved input. numInterleavedChannels unsigned int
The total number of channels in the interleaved input. stereoOutput float *
Stereo interleaved output. channelIndex unsigned int
Copy this channel. channelIndex is the left side, channelIndex + 1 is the right side. numberOfFrames unsigned int
The number of frames to process. NoneCopyStereoToInterleaved
METHODCopy interleaved stereo into an interleaved buffer.ParametersReturnsName Type Description stereoInput Number (pointer in Linear Memory)
Stereo interleaved input. channelIndex Number
Copy to this channel pair. eg with 2: left channel goes to 2, right channel goes to 2 + 1. interleavedOutput Number (pointer in Linear Memory)
Interleaved output. numInterleavedChannels Number
The total number of channels in the interleaved output. numberOfFrames Number
The number of frames to process. multiplier Number
Multiply the output with this number (constant volume). NoneCopyStereoToInterleaved
METHODCopy interleaved stereo into an interleaved buffer.ParametersReturnsName Type Default Description stereoInput float *
Stereo interleaved input. channelIndex unsigned int
Copy to this channel pair. eg with 2: left channel goes to 2, right channel goes to 2 + 1. interleavedOutput float *
Interleaved output. numInterleavedChannels unsigned int
The total number of channels in the interleaved output. numberOfFrames unsigned int
The number of frames to process. multiplier float
Multiply the output with this number (constant volume). NoneCrossMono
METHODCrossfades two mono input channels into a mono output: output = inputA * gain + inputB + gain.ParametersReturnsName Type Description inputA Number (pointer in Linear Memory)
First mono input. inputB Number (pointer in Linear Memory)
Second mono input. output Number (pointer in Linear Memory)
Mono output. Can be equal with one of the inputs (in-place processing). inputAGainStart Number
Gain of the first sample on the first input. inputAGainEnd Number
Gain for the last sample on the first input. Gain will be smoothly calculated between start and end. inputBGainStart Number
Gain of the first sample on the second input. inputBGainEnd Number
Gain for the last sample on the second input. Gain will be smoothly calculated between start and end. numberOfFrames Number
The number of frames to process. NoneCrossMono
METHODCrossfades two mono input channels into a mono output: output = inputA * gain + inputB + gain.ParametersReturnsName Type Default Description inputA float *
First mono input. inputB float *
Second mono input. output float *
Mono output. Can be equal with one of the inputs (in-place processing). inputAGainStart float
Gain of the first sample on the first input. inputAGainEnd float
Gain for the last sample on the first input. Gain will be smoothly calculated between start and end. inputBGainStart float
Gain of the first sample on the second input. inputBGainEnd float
Gain for the last sample on the second input. Gain will be smoothly calculated between start and end. numberOfFrames unsigned int
The number of frames to process. NoneCrossStereo
METHODCrossfades two stereo inputs into a stereo output: output = inputA * gain + inputB + gain.ParametersReturnsName Type Description inputA Number (pointer in Linear Memory)
First stereo input. inputB Number (pointer in Linear Memory)
Second stereo input. output Number (pointer in Linear Memory)
Stereo output. Can be equal with one of the inputs (in-place processing). inputAGainStart Number
Gain of the first sample on the first input. inputAGainEnd Number
Gain for the last sample on the first input. Gain will be smoothly calculated between start and end. inputBGainStart Number
Gain of the first sample on the second input. inputBGainEnd Number
Gain for the last sample on the second input. Gain will be smoothly calculated between start and end. numberOfFrames Number
The number of frames to process. NoneCrossStereo
METHODCrossfades two stereo inputs into a stereo output: output = inputA * gain + inputB + gain.ParametersReturnsName Type Default Description inputA float *
First stereo input. inputB float *
Second stereo input. output float *
Stereo output. Can be equal with one of the inputs (in-place processing). inputAGainStart float
Gain of the first sample on the first input. inputAGainEnd float
Gain for the last sample on the first input. Gain will be smoothly calculated between start and end. inputBGainStart float
Gain of the first sample on the second input. inputBGainEnd float
Gain for the last sample on the second input. Gain will be smoothly calculated between start and end. numberOfFrames unsigned int
The number of frames to process. NoneDeInterleave
METHODDeinterleaves an interleaved stereo input to two mono output channels: left = [L, L, L, L, ...], right = [R, R, R, R, ...].ParametersReturnsName Type Description input Number (pointer in Linear Memory)
Stereo interleaved input. left Number (pointer in Linear Memory)
Mono output for left channel. right Number (pointer in Linear Memory)
Mono output for right channel. numberOfFrames Number
The number of frames to process. NoneDeInterleave
METHODDeinterleaves an interleaved stereo input to two mono output channels: left = [L, L, L, L, ...], right = [R, R, R, R, ...].ParametersReturnsName Type Default Description input float *
Stereo interleaved input. left float *
Mono output for left channel. right float *
Mono output for right channel. numberOfFrames unsigned int
The number of frames to process. NoneDeInterleaveAdd
METHODDeinterleaves an interleaved stereo input and adds the results to the two mono output channels: left = left + [L, L, L, L, ...], right = right + [R, R, R, R, ...]ParametersReturnsName Type Description input Number (pointer in Linear Memory)
Stereo interleaved input. left Number (pointer in Linear Memory)
Mono output for left channel. right Number (pointer in Linear Memory)
Mono output for right channel. numberOfFrames Number
The number of frames to process. NoneDeInterleaveAdd
METHODDeinterleaves an interleaved stereo input and adds the results to the two mono output channels: left = left + [L, L, L, L, ...], right = right + [R, R, R, R, ...]ParametersReturnsName Type Default Description input float *
Stereo interleaved input. left float *
Mono output for left channel. right float *
Mono output for right channel. numberOfFrames unsigned int
The number of frames to process. NoneDeInterleaveMultiply
METHODDeinterleaves an interleaved stereo input to two mono output channels and multiplies the output (gain): left = [L, L, L, L, ...] * gain, right = [R, R, R, R, ...] * gainParametersReturnsName Type Description input Number (pointer in Linear Memory)
Stereo interleaved input. left Number (pointer in Linear Memory)
Mono output for left channel. right Number (pointer in Linear Memory)
Mono output for right channel. numberOfFrames Number
The number of frames to process. multiplier Number
Multiply each output sample with this value. NoneDeInterleaveMultiply
METHODDeinterleaves an interleaved stereo input to two mono output channels and multiplies the output (gain): left = [L, L, L, L, ...] * gain, right = [R, R, R, R, ...] * gainParametersReturnsName Type Default Description input float *
Stereo interleaved input. left float *
Mono output for left channel. right float *
Mono output for right channel. numberOfFrames unsigned int
The number of frames to process. multiplier float
Multiply each output sample with this value. NoneDeInterleaveMultiplyAdd
METHODDeinterleaves an interleaved stereo input to two mono output channels, multiplies the result (gain) and and adds the results to the two mono output channels: left = left + [L, L, L, L, ...] * gain, right = right + [R, R, R, R, ...] * gainParametersReturnsName Type Description input Number (pointer in Linear Memory)
Stereo interleaved input. left Number (pointer in Linear Memory)
Mono output for left channel. right Number (pointer in Linear Memory)
Mono output for right channel. numberOfFrames Number
The number of frames to process. multiplier Number
Multiply each output sample with this value. NoneDeInterleaveMultiplyAdd
METHODDeinterleaves an interleaved stereo input to two mono output channels, multiplies the result (gain) and and adds the results to the two mono output channels: left = left + [L, L, L, L, ...] * gain, right = right + [R, R, R, R, ...] * gainParametersReturnsName Type Default Description input float *
Stereo interleaved input. left float *
Mono output for left channel. right float *
Mono output for right channel. numberOfFrames unsigned int
The number of frames to process. multiplier float
Multiply each output sample with this value. NoneDotProduct
METHODCalculates the dot product of two vectors.ParametersReturnsName Type Description inputA Number (pointer in Linear Memory)
First input vector. inputB Number (pointer in Linear Memory)
Second input vector. numValues Number
Number of value pairs to process. Type Description Number
The dot product. DotProduct
METHODCalculates the dot product of two vectors.ParametersReturnsName Type Default Description inputA float *
First input vector. inputB float *
Second input vector. numValues unsigned int
Number of value pairs to process. Type Description float
The dot product. FloatTo24bit
METHODConverts 32-bit floating point audio to 24-bit.ParametersReturnsName Type Description input Number (pointer in Linear Memory)
32-bit input. output Number (pointer in Linear Memory)
24-bit output. numberOfFrames Number
The number of frames to process. numberOfChannels Number
The number of channels. NoneFloatTo24bit
METHODConverts 32-bit floating point audio to 24-bit.ParametersReturnsName Type Default Description input float *
32-bit input. output void *
24-bit output. numberOfFrames unsigned int
The number of frames to process. numberOfChannels unsigned int
2 The number of channels. NoneFloatToChar
METHODConverts 32-bit floating point audio 8-bit audio.ParametersReturnsName Type Description input Number (pointer in Linear Memory)
32-bit input. output Number (pointer in Linear Memory)
8-bit output. numberOfFrames Number
The number of frames to process. numberOfChannels Number
The number of channels. NoneFloatToChar
METHODConverts 32-bit floating point audio 8-bit audio.ParametersReturnsName Type Default Description input float *
32-bit input. output signed char *
8-bit output. numberOfFrames unsigned int
The number of frames to process. numberOfChannels unsigned int
2 The number of channels. NoneFloatToInt
METHODConverts 32-bit floating point audio to 32-bit integer.ParametersReturnsName Type Description input Number (pointer in Linear Memory)
32-bit input. output Number (pointer in Linear Memory)
32-bit output. numberOfFrames Number
The number of frames to process. numberOfChannels Number
The number of channels. NoneFloatToInt
METHODConverts 32-bit floating point audio to 32-bit integer.ParametersReturnsName Type Default Description input float *
32-bit input. output int *
32-bit output. numberOfFrames unsigned int
The number of frames to process. numberOfChannels unsigned int
2 The number of channels. NoneFloatToShortInt
METHODConverts 32-bit float input to 16-bit signed integer output.ParametersReturnsName Type Description input Number (pointer in Linear Memory)
32-bit input. output Number (pointer in Linear Memory)
16-bit output. numberOfFrames Number
The number of frames to process. numberOfChannels Number
The number of channels. NoneFloatToShortInt
METHODConverts 32-bit float input to 16-bit signed integer output.ParametersReturnsName Type Default Description input float *
32-bit input. output short int *
16-bit output. numberOfFrames unsigned int
The number of frames to process. numberOfChannels unsigned int
2 The number of channels. NoneFloatToShortIntInterleave
METHODConverts two 32-bit mono float input channels to stereo interleaved 16-bit signed integer output.ParametersReturnsName Type Description inputLeft Number (pointer in Linear Memory)
32-bit input for the left side. Should be numberOfFrames + 8 big minimum. inputRight Number (pointer in Linear Memory)
32-bit input for the right side. Should be numberOfFrames + 8 big minimum. output Number (pointer in Linear Memory)
Stereo interleaved 16-bit output. Should be numberOfFrames * 2 + 16 big minimum. numberOfFrames Number
The number of frames to process. NoneFloatToShortIntInterleave
METHODConverts two 32-bit mono float input channels to stereo interleaved 16-bit signed integer output.ParametersReturnsName Type Default Description inputLeft float *
32-bit input for the left side. Should be numberOfFrames + 8 big minimum. inputRight float *
32-bit input for the right side. Should be numberOfFrames + 8 big minimum. output short int *
Stereo interleaved 16-bit output. Should be numberOfFrames * 2 + 16 big minimum. numberOfFrames unsigned int
The number of frames to process. NonefrequencyOfNote
METHODReturns the frequency of a specific note.ParametersReturnsName Type Description note Number
The index of the note. Note 0 is the standard A note at 440 Hz. Type Description Number
The frequency in Hz. frequencyOfNote
METHODReturns the frequency of a specific note.ParametersReturnsName Type Default Description note int
The index of the note. Note 0 is the standard A note at 440 Hz. Type Description float
The frequency in Hz. GetPeaks
METHODGet the peak values of each channel in an interleaved buffer.ParametersReturnsName Type Description interleavedInput Number (pointer in Linear Memory)
Interleaved input. numInterleavedChannels Number
The total number of channels in the interleaved input. numberOfFrames Number
The number of frames to process. peaks Number (pointer in Linear Memory)
Peak value result, should be able to store totalChannels values minimum. NoneGetPeaks
METHODGet the peak values of each channel in an interleaved buffer.ParametersReturnsName Type Default Description interleavedInput float *
Interleaved input. numInterleavedChannels unsigned int
The total number of channels in the interleaved input. numberOfFrames unsigned int
The number of frames to process. peaks float *
Peak value result, should be able to store totalChannels values minimum. NoneHasNonFinite
METHODChecks if the audio samples has non-valid values, such as infinity or NaN (not a number).ParametersReturnsName Type Description input Number (pointer in Linear Memory)
Floating point numbers to check. numberOfValues Number
Number of values in the buffer. Please note, this is NOT numberOfFrames. You need to provide the number of floating point numbers in the buffer. Type Description Boolean
HasNonFinite
METHODChecks if the audio samples has non-valid values, such as infinity or NaN (not a number).ParametersReturnsName Type Default Description input float *
Floating point numbers to check. numberOfValues unsigned int
Number of values in the buffer. Please note, this is NOT numberOfFrames. You need to provide the number of floating point numbers in the buffer. Type Description bool
Interleave
METHODMakes an interleaved stereo output from two mono input channels: output = [L, R, L, R, ...]..ParametersReturnsName Type Description left Number (pointer in Linear Memory)
Mono input for left channel. right Number (pointer in Linear Memory)
Mono input for right channel. output Number (pointer in Linear Memory)
Stereo interleaved output. numberOfFrames Number
The number of frames to process. NoneInterleave
METHODMakes an interleaved stereo output from two mono input channels: output = [L, R, L, R, ...]..ParametersReturnsName Type Default Description left float *
Mono input for left channel. right float *
Mono input for right channel. output float *
Stereo interleaved output. numberOfFrames unsigned int
The number of frames to process. NoneInterleaveAdd
METHODMakes an interleaved stereo output from two mono input channels and adds the result to the audio in the output buffer: output = output + [L, R, L, R, ...]ParametersReturnsName Type Description left Number (pointer in Linear Memory)
Mono input for left channel. right Number (pointer in Linear Memory)
Mono input for right channel. output Number (pointer in Linear Memory)
Stereo interleaved output. numberOfFrames Number
The number of frames to process. NoneInterleaveAdd
METHODMakes an interleaved stereo output from two mono input channels and adds the result to the audio in the output buffer: output = output + [L, R, L, R, ...]ParametersReturnsName Type Default Description left float *
Mono input for left channel. right float *
Mono input for right channel. output float *
Stereo interleaved output. numberOfFrames unsigned int
The number of frames to process. NoneInterleaveAndGetPeaks
METHODMakes an interleaved output from two input channels and measures the volume: output = [L, R, L, R, ...]ParametersReturnsName Type Description left Number (pointer in Linear Memory)
Mono input for left channel. right Number (pointer in Linear Memory)
Mono input for right channel. output Number (pointer in Linear Memory)
Stereo interleaved output. numberOfFrames Number
The number of frames to process. peaks Number (pointer in Linear Memory)
Pointer to two floating point numbers in Linear Memory. Peak value result (left, right). NoneInterleaveAndGetPeaks
METHODMakes an interleaved output from two input channels and measures the volume: output = [L, R, L, R, ...]ParametersReturnsName Type Default Description left float *
Mono input for left channel. right float *
Mono input for right channel. output float *
Stereo interleaved output. numberOfFrames unsigned int
The number of frames to process. peaks float *
Pointer to two floating point numbers. Peak value result (left, right). NoneIntToFloat
METHODConverts 32-bit integer audio to 32-bit floating point.ParametersReturnsName Type Description input Number (pointer in Linear Memory)
32-bit input. output Number (pointer in Linear Memory)
32-bit output. numberOfFrames Number
The number of frames to process. numberOfChannels Number
The number of channels. NoneIntToFloat
METHODConverts 32-bit integer audio to 32-bit floating point.ParametersReturnsName Type Default Description input int *
32-bit input. output float *
32-bit output. numberOfFrames unsigned int
The number of frames to process. numberOfChannels unsigned int
2 The number of channels. NoneMidSideToStereo
METHODConverts a mid-side signal to stereo.ParametersReturnsName Type Description input Number (pointer in Linear Memory)
Mid-side interleaved input. output Number (pointer in Linear Memory)
Interleaved stereo output. Can be equal to input (in-place processing). numberOfFrames Number
The number of frames to process. NoneMidSideToStereo
METHODConverts a mid-side signal to stereo.ParametersReturnsName Type Default Description input float *
Mid-side interleaved input. output float *
Interleaved stereo output. Can be equal to input (in-place processing). numberOfFrames unsigned int
The number of frames to process. NonePeak
METHODReturns the peak absolute value. Useful for metering.ParametersReturnsName Type Description input Number (pointer in Linear Memory)
Input values. numberOfValues Number
The number of values to process. For a stereo input this value should be 2 * numberOfFrames. Must be a multiply of 8. Type Description Number
Peak absolute value. Peak
METHODReturns the peak absolute value. Useful for metering.ParametersReturnsName Type Default Description input float *
Input values. numberOfValues unsigned int
The number of values to process. For a stereo input this value should be 2 * numberOfFrames. Must be a multiply of 8. Type Description float
Peak absolute value. ShortIntToFloat
METHODConverts 16-bit signed integer input to 32-bit float output.ParametersReturnsName Type Description input Number (pointer in Linear Memory)
Stereo interleaved 16-bit input. output Number (pointer in Linear Memory)
Stereo interleaved 32-bit output. numberOfFrames Number
The number of frames to process. numberOfChannels Number
The number of channels. NoneShortIntToFloat
METHODConverts 16-bit signed integer input to 32-bit float output.ParametersReturnsName Type Default Description input short int *
Stereo interleaved 16-bit input. output float *
Stereo interleaved 32-bit output. numberOfFrames unsigned int
The number of frames to process. numberOfChannels unsigned int
2 The number of channels. NoneShortIntToFloatGetPeaks
METHODConverts stereo interleaved 16-bit signed integer input to stereo interleaved 32-bit float output, and provides peak measurement.ParametersReturnsName Type Description input Number (pointer in Linear Memory)
Stereo interleaved 16-bit input. Should be numberOfFrames + 8 big minimum. output Number (pointer in Linear Memory)
Stereo interleaved 32-bit output. Should be numberOfFrames + 8 big minimum. numberOfFrames Number
The number of frames to process. peaks Number (pointer in Linear Memory)
Pointer to two floating point numbers. Peak value result (left, right). NoneShortIntToFloatGetPeaks
METHODConverts stereo interleaved 16-bit signed integer input to stereo interleaved 32-bit float output, and provides peak measurement.ParametersReturnsName Type Default Description input short int *
Stereo interleaved 16-bit input. Should be numberOfFrames + 8 big minimum. output float *
Stereo interleaved 32-bit output. Should be numberOfFrames + 8 big minimum. numberOfFrames unsigned int
The number of frames to process. peaks float *
Pointer to two floating point numbers. Peak value result (left, right). NoneStereoToMidSide
METHODConverts a stereo signal to mid-side.ParametersReturnsName Type Description input Number (pointer in Linear Memory)
Interleaved stereo input. output Number (pointer in Linear Memory)
Mid-side interleaved output. Can be equal to input (in-place processing). numberOfFrames Number
The number of frames to process. NoneStereoToMidSide
METHODConverts a stereo signal to mid-side.ParametersReturnsName Type Default Description input float *
Interleaved stereo input. output float *
Mid-side interleaved output. Can be equal to input (in-place processing). numberOfFrames unsigned int
The number of frames to process. NoneStereoToMono
METHODMakes mono output from stereo interleaved input: output = [L + R], [L + R], [L + R], ...ParametersReturnsName Type Description input Number (pointer in Linear Memory)
Stereo interleaved input. output Number (pointer in Linear Memory)
Mono output. leftGainStart Number
Gain of the first sample on the left channel. leftGainEnd Number
Gain for the last sample on the left channel. Gain will be smoothly calculated between start and end. rightGainStart Number
Gain of the first sample on the right channel. rightGainEnd Number
Gain for the last sample on the right channel. Gain will be smoothly calculated between start and end. numberOfFrames Number
The number of frames to process. NoneStereoToMono
METHODMakes mono output from stereo interleaved input: output = [L + R], [L + R], [L + R], ...ParametersReturnsName Type Default Description input float *
Stereo interleaved input. output float *
Mono output. leftGainStart float
Gain of the first sample on the left channel. leftGainEnd float
Gain for the last sample on the left channel. Gain will be smoothly calculated between start and end. rightGainStart float
Gain of the first sample on the right channel. rightGainEnd float
Gain for the last sample on the right channel. Gain will be smoothly calculated between start and end. numberOfFrames unsigned int
The number of frames to process. NoneVersion
METHODReturns the current version of the Superpowered SDK.ParametersNoneReturnsType Description Number
The returned value is: major version * 10000 + minor version * 100 + revision. Example: 10402 means 1.4.2 Version
METHODReturns the current version of the Superpowered SDK.ParametersNoneReturnsType Description unsigned int
The returned value is: major version * 10000 + minor version * 100 + revision. Example: 10402 means 1.4.2 Volume
METHODApplies volume on a single stereo interleaved buffer: output = input * gainParametersReturnsName Type Description input Number (pointer in Linear Memory)
32-bit interleaved stereo input. output Number (pointer in Linear Memory)
32-bit interleaved stereo output. Can be equal to input (in-place processing). volumeStart Number
Volume for the first frame. volumeEnd Number
Volume for the last frame. Volume will be smoothly calculated between the first and last frames. numberOfFrames Number
Number of frames to process. NoneVolume
METHODApplies volume on a single stereo interleaved buffer: output = input * gainParametersReturnsName Type Default Description input float *
32-bit interleaved stereo input. output float *
32-bit interleaved stereo output. Can be equal to input (in-place processing). volumeStart float
Volume for the first frame. volumeEnd float
Volume for the last frame. Volume will be smoothly calculated between the first and last frames. numberOfFrames unsigned int
Number of frames to process. NoneVolumeAdd
METHODApplies volume on a single stereo interleaved buffer and adds it to the audio in the output buffer: output = output + input * gain.ParametersReturnsName Type Description input Number (pointer in Linear Memory)
32-bit interleaved stereo input. output Number (pointer in Linear Memory)
32-bit interleaved stereo output. Can be equal to input (in-place processing). volumeStart Number
Volume for the first frame. volumeEnd Number
Volume for the last frame. Volume will be smoothly calculated between the first and last frames numberOfFrames Number
Number of frames to process. NoneVolumeAdd
METHODApplies volume on a single stereo interleaved buffer and adds it to the audio in the output buffer: output = output + input * gain.ParametersReturnsName Type Default Description input float *
32-bit interleaved stereo input. output float *
32-bit interleaved stereo output. Can be equal to input (in-place processing). volumeStart float
Volume for the first frame. volumeEnd float
Volume for the last frame. Volume will be smoothly calculated between the first and last frames numberOfFrames unsigned int
Number of frames to process. None