WAV utilities

  • closeWAV

    METHOD
    Closes a 16-bit stereo WAV file. fclose() is not enough to create a valid a WAV file, use this function to close it.
    Parameters
    NameTypeDefaultDescription
    fdFILE *The file handle to write into.
    Returns
    None
  • createWAV

    METHOD
    Creates 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.
    Parameters
    NameTypeDefaultDescription
    pathconst char *The full filesystem path of the file.
    samplerateunsigned intSample rate of the file in Hz.
    numChannelsunsigned charThe number of channels.
    Returns
    TypeDescription
    FILE *A file handle (success) or NULL (error).
  • createWAVfd

    METHOD
    Creates 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.
    Parameters
    NameTypeDefaultDescription
    fdintExisting file descriptor. Superpowered will fdopen on this using "w" mode.
    samplerateunsigned intSample rate of the file in Hz.
    numChannelsunsigned charThe number of channels.
    Returns
    TypeDescription
    FILE *A file handle (success) or NULL (error).
  • writeWAV

    METHOD
    Writes audio into a WAV file.
    Parameters
    NameTypeDefaultDescription
    fdFILE *The file handle to write into.
    audioshort int *16-bit audio to write.
    numberOfBytesunsigned intThe number of bytes to write.
    Returns
    TypeDescription
    boolReturns true for success and false for error.
Javascript

is not supported here.

v2.7.2