AudioFileStreamOpen

Function AudioFileStreamOpen 

Source
pub unsafe extern "C-unwind" fn AudioFileStreamOpen(
    in_client_data: *mut c_void,
    in_property_listener_proc: AudioFileStream_PropertyListenerProc,
    in_packets_proc: AudioFileStream_PacketsProc,
    in_file_type_hint: AudioFileTypeID,
    out_audio_file_stream: NonNull<AudioFileStreamID>,
) -> i32
Available on crate features AudioFile and AudioFileStream and objc2-core-audio-types only.
Expand description

Create a new audio file stream parser. The client provides the parser with data and the parser calls callbacks when interesting things are found in the data, such as properties and audio packets.

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

Parameter inPropertyListenerProc: Whenever the value of a property is parsed in the data, this function will be called. You can then get the value of the property from in the callback. In some cases, due to boundaries in the input data, the property may return kAudioFileStreamError_DataUnavailable. When unavailable data is requested from within the property listener, the parser will begin caching the property value and will call the property listener again when the property is available. For property values for which kAudioFileStreamPropertyFlag_PropertyIsCached is unset, this will be the only opportunity to get the value of the property, since the data will be disposed upon return of the property listener callback.

Parameter inPacketsProc: Whenever packets are parsed in the data, a pointer to the packets is passed to the client using this callback. At times only a single packet may be passed due to boundaries in the input data.

Parameter inFileTypeHint: For files whose type cannot be easily or uniquely determined from the data (ADTS,AC3), this hint can be used to indicate the file type. Otherwise if you do not know the file type, you can pass zero.

Parameter outAudioFileStream: A new file stream ID for use in other AudioFileStream API calls.

ยงSafety

  • in_client_data must be a valid pointer or null.
  • in_property_listener_proc must be implemented correctly.
  • in_packets_proc must be implemented correctly.
  • out_audio_file_stream must be a valid pointer.