WAV utilities
closeWAV
METHODCloses a 16-bit stereo WAV file. fclose() is not enough to create a valid a WAV file, use this function to close it.ParametersReturnsName Type Default Description fd FILE *The file handle to write into. NonecreateWAV
METHODCreates a 16-bit WAV file. After createWAV, write audio data using the writeWAV() function or fwrite(). Close the file with the closeWAV() function. Never use direct disk writing in a real-time audio processing thread, use the Superpowered Recorder class in that case.ParametersReturnsName Type Default Description path const char *The full filesystem path of the file. samplerate unsigned intSample rate of the file in Hz. numChannels unsigned charThe number of channels. Type Description FILE *A file handle (success) or NULL (error). createWAVfd
METHODCreates a 16-bit WAV file. After createWAVfd, write audio data using the writeWAV() function or fwrite(). Close the file with the closeWAV() function. Never use direct disk writing in a real-time audio processing thread, use the Superpowered Recorder class in that case.ParametersReturnsName Type Default Description fd intExisting file descriptor. Superpowered will fdopen on this using "w" mode. samplerate unsigned intSample rate of the file in Hz. numChannels unsigned charThe number of channels. Type Description FILE *A file handle (success) or NULL (error). writeWAV
METHODWrites audio into a WAV file.ParametersReturnsName Type Default Description fd FILE *The file handle to write into. audio short int *16-bit audio to write. numberOfBytes unsigned intThe number of bytes to write. Type Description boolReturns true for success and false for error.