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 NumberThe 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 intThe 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 NumberThe 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 intThe 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 NumberThe 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 intThe 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 NumberThe number of frames to process. numberOfChannels NumberThe 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 intThe number of frames to process. numberOfChannels unsigned int2 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 NumberVolume for the first frame. volumeChange NumberChange volume by this amount for every frame. numberOfFrames NumberNumber 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 floatVolume for the first frame. volumeChange floatChange volume by this amount for every frame. numberOfFrames unsigned intNumber 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 NumberVolume for the first frame. volumeChange NumberChange volume by this amount for every frame. numberOfFrames NumberNumber 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 floatVolume for the first frame. volumeChange floatChange volume by this amount for every frame. numberOfFrames NumberNumber 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 NumberThe number of frames to process. numberOfChannels NumberThe 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 intThe number of frames to process. numberOfChannels unsigned int2 The number of channels. NoneCopyMonoFromInterleaved
METHODCopy mono audio from an interleaved buffer.ParametersReturnsName Type Description interleavedInput Number (pointer in Linear Memory)Interleaved input. numInterleavedChannels NumberThe total number of channels in the interleaved input. monoOutput Number (pointer in Linear Memory)Mono output. channelIndex NumberCopy this channel. numberOfFrames NumberThe number of frames to process. NoneCopyMonoFromInterleaved
METHODCopy mono audio from an interleaved buffer.ParametersReturnsName Type Default Description interleavedInput float *Interleaved input. numInterleavedChannels unsigned intThe total number of channels in the interleaved input. monoOutput float *Mono output. channelIndex unsigned intCopy this channel. numberOfFrames unsigned intThe 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 NumberCopy to this channel. interleavedOutput Number (pointer in Linear Memory)Interleaved output. numInterleavedChannels NumberThe total number of channels in the interleaved output. numberOfFrames NumberThe number of frames to process. NoneCopyMonoToInterleaved
METHODCopy a mono channel into an interleaved buffer.ParametersReturnsName Type Default Description monoInput float *Mono input. channelIndex unsigned intCopy to this channel. interleavedOutput float *Interleaved output. numInterleavedChannels unsigned intThe total number of channels in the interleaved output. numberOfFrames unsigned intThe 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 NumberThe total number of channels in the interleaved input. stereoOutput Number (pointer in Linear Memory)Stereo interleaved output. channelIndex NumberCopy this channel. channelIndex is the left side, channelIndex + 1 is the right side. numberOfFrames NumberThe number of frames to process. NoneCopyStereoFromInterleaved
METHODCopy stereo audio from an interleaved buffer.ParametersReturnsName Type Default Description interleavedInput float *Interleaved input. numInterleavedChannels unsigned intThe total number of channels in the interleaved input. stereoOutput float *Stereo interleaved output. channelIndex unsigned intCopy this channel. channelIndex is the left side, channelIndex + 1 is the right side. numberOfFrames unsigned intThe 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 NumberCopy 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 NumberThe total number of channels in the interleaved output. numberOfFrames NumberThe number of frames to process. multiplier NumberMultiply 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 intCopy to this channel pair. eg with 2: left channel goes to 2, right channel goes to 2 + 1. interleavedOutput float *Interleaved output. numInterleavedChannels unsigned intThe total number of channels in the interleaved output. numberOfFrames unsigned intThe number of frames to process. multiplier floatMultiply 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 NumberGain of the first sample on the first input. inputAGainEnd NumberGain for the last sample on the first input. Gain will be smoothly calculated between start and end. inputBGainStart NumberGain of the first sample on the second input. inputBGainEnd NumberGain for the last sample on the second input. Gain will be smoothly calculated between start and end. numberOfFrames NumberThe 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 floatGain of the first sample on the first input. inputAGainEnd floatGain for the last sample on the first input. Gain will be smoothly calculated between start and end. inputBGainStart floatGain of the first sample on the second input. inputBGainEnd floatGain for the last sample on the second input. Gain will be smoothly calculated between start and end. numberOfFrames unsigned intThe 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 NumberGain of the first sample on the first input. inputAGainEnd NumberGain for the last sample on the first input. Gain will be smoothly calculated between start and end. inputBGainStart NumberGain of the first sample on the second input. inputBGainEnd NumberGain for the last sample on the second input. Gain will be smoothly calculated between start and end. numberOfFrames NumberThe 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 floatGain of the first sample on the first input. inputAGainEnd floatGain for the last sample on the first input. Gain will be smoothly calculated between start and end. inputBGainStart floatGain of the first sample on the second input. inputBGainEnd floatGain for the last sample on the second input. Gain will be smoothly calculated between start and end. numberOfFrames unsigned intThe 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 NumberThe 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 intThe 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 NumberThe 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 intThe 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 NumberThe number of frames to process. multiplier NumberMultiply 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 intThe number of frames to process. multiplier floatMultiply 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 NumberThe number of frames to process. multiplier NumberMultiply 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 intThe number of frames to process. multiplier floatMultiply 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 NumberNumber of value pairs to process. Type Description NumberThe 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 intNumber of value pairs to process. Type Description floatThe 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 NumberThe number of frames to process. numberOfChannels NumberThe 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 intThe number of frames to process. numberOfChannels unsigned int2 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 NumberThe number of frames to process. numberOfChannels NumberThe 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 intThe number of frames to process. numberOfChannels unsigned int2 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 NumberThe number of frames to process. numberOfChannels NumberThe 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 intThe number of frames to process. numberOfChannels unsigned int2 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 NumberThe number of frames to process. numberOfChannels NumberThe 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 intThe number of frames to process. numberOfChannels unsigned int2 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 NumberThe 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 intThe number of frames to process. NonefrequencyOfNote
METHODReturns the frequency of a specific note.ParametersReturnsName Type Description note NumberThe index of the note. Note 0 is the standard A note at 440 Hz. Type Description NumberThe frequency in Hz. frequencyOfNote
METHODReturns the frequency of a specific note.ParametersReturnsName Type Default Description note intThe index of the note. Note 0 is the standard A note at 440 Hz. Type Description floatThe 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 NumberThe total number of channels in the interleaved input. numberOfFrames NumberThe 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 intThe total number of channels in the interleaved input. numberOfFrames unsigned intThe 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 NumberNumber 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 BooleanHasNonFinite
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 intNumber 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 boolInterleave
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 NumberThe 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 intThe 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 NumberThe 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 intThe 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 NumberThe 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 intThe 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 NumberThe number of frames to process. numberOfChannels NumberThe 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 intThe number of frames to process. numberOfChannels unsigned int2 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 NumberThe 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 intThe 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 NumberThe number of values to process. For a stereo input this value should be 2 * numberOfFrames. Must be a multiply of 8. Type Description NumberPeak absolute value. Peak
METHODReturns the peak absolute value. Useful for metering.ParametersReturnsName Type Default Description input float *Input values. numberOfValues unsigned intThe number of values to process. For a stereo input this value should be 2 * numberOfFrames. Must be a multiply of 8. Type Description floatPeak 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 NumberThe number of frames to process. numberOfChannels NumberThe 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 intThe number of frames to process. numberOfChannels unsigned int2 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 NumberThe 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 intThe 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 NumberThe 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 intThe 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 NumberGain of the first sample on the left channel. leftGainEnd NumberGain for the last sample on the left channel. Gain will be smoothly calculated between start and end. rightGainStart NumberGain of the first sample on the right channel. rightGainEnd NumberGain for the last sample on the right channel. Gain will be smoothly calculated between start and end. numberOfFrames NumberThe 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 floatGain of the first sample on the left channel. leftGainEnd floatGain for the last sample on the left channel. Gain will be smoothly calculated between start and end. rightGainStart floatGain of the first sample on the right channel. rightGainEnd floatGain for the last sample on the right channel. Gain will be smoothly calculated between start and end. numberOfFrames unsigned intThe number of frames to process. NoneVersion
METHODReturns the current version of the Superpowered SDK.ParametersNoneReturnsType Description NumberThe 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 intThe 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 NumberVolume for the first frame. volumeEnd NumberVolume for the last frame. Volume will be smoothly calculated between the first and last frames. numberOfFrames NumberNumber 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 floatVolume for the first frame. volumeEnd floatVolume for the last frame. Volume will be smoothly calculated between the first and last frames. numberOfFrames unsigned intNumber 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 NumberVolume for the first frame. volumeEnd NumberVolume for the last frame. Volume will be smoothly calculated between the first and last frames numberOfFrames NumberNumber 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 floatVolume for the first frame. volumeEnd floatVolume for the last frame. Volume will be smoothly calculated between the first and last frames numberOfFrames unsigned intNumber of frames to process. None