Skip to main content

WavUtility

Module: Inworld.AI. Namespace: Inworld. This is the Inworld customized version of WavUtility used to convert wave data to/from other format.

API

FunctionsDescriptionParameters
ShortArrayToWavFileGenerate a wav files from the short array.shortArray: the short array to transfer.
outputPath: the path to generate.
sampleRate: the sample rate.
ToAudioClipGets the wave file from Unity's Resource folder.filePath: the file path to load the wave data.
ToAudioClipGenerate the Audio clip by byte array.fileBytes: the date to convert.
offsetSamples:the offset of the audio.
name:the name of the wav file.
ConvertAudioClipDataToInt16ByteArrayConvert the audio clip float data to int16 array then convert to byte array. Short array is the data format we use in the Inworld server.input: the audio clip data.
size: the size of the wave data.
output: the short array.
ConvertAudioClipDataToInt16ByteArrayConvert the float array to int16 array then convert to byte array. Short array is the data format we use in the Inworld server.data: the float array of wave data.
ConvertAudioClipDataToInt32ByteArrayConvert the audio clip float data to int array. Still keep the API but Inworld don't process int array.input: the audio clip data.
size: the size of the wave data.
output: the int32 array.
ConvertAudioClipDataToInt16ArrayConvert the audio clip float data to short array. Short array is the data format we use in the Inworld server.input: the audio clip data.
size: the size of the wave data.
FromAudioClipGet the byte array of the wave data from AudioClipaudioClip: the input audio clip
FromAudioClipGet the byte array of the wave data from AudioClipaudioClip: the input audio clip
filepath: the file path of the wave file.
saveAsFile: check if the data is saved as file
dirname: the directory of the wave file.
BitDepthGet the bit depth of the audio clipaudioClip: the target clip to sample.