AudioFileInitializeWithCallbacks

Function AudioFileInitializeWithCallbacks 

Source
pub unsafe extern "C-unwind" fn AudioFileInitializeWithCallbacks(
    in_client_data: NonNull<c_void>,
    in_read_func: AudioFile_ReadProc,
    in_write_func: AudioFile_WriteProc,
    in_get_size_func: AudioFile_GetSizeProc,
    in_set_size_func: AudioFile_SetSizeProc,
    in_file_type: AudioFileTypeID,
    in_format: NonNull<AudioStreamBasicDescription>,
    in_flags: AudioFileFlags,
    out_audio_file: NonNull<AudioFileID>,
) -> i32
Available on crate features AudioFile and objc2-core-audio-types only.
Expand description

Wipe clean an existing file. You provide callbacks that the AudioFile API will use to get the data.

Parameter inClientData: a constant that will be passed to your callbacks.

Parameter inReadFunc: a function that will be called when AudioFile needs to read data.

Parameter inWriteFunc: a function that will be called when AudioFile needs to write data.

Parameter inGetSizeFunc: a function that will be called when AudioFile needs to know the file size.

Parameter inSetSizeFunc: a function that will be called when AudioFile needs to set the file size.

Parameter inFileType: an AudioFileTypeID indicating the type of audio file to which to initialize the file.

Parameter inFormat: an AudioStreamBasicDescription describing the data format that will be added to the audio file.

Parameter inFlags: flags for creating/opening the file. Currently zero.

Parameter outAudioFile: upon success, an AudioFileID that can be used for subsequent AudioFile calls.

Returns: returns noErr if successful.

ยงSafety

  • in_client_data must be a valid pointer.
  • in_read_func must be implemented correctly.
  • in_write_func must be implemented correctly.
  • in_get_size_func must be implemented correctly.
  • in_set_size_func must be implemented correctly.
  • in_format must be a valid pointer.
  • out_audio_file must be a valid pointer.