init(pcmFormat:frameCapacity:)
Creates a PCM audio buffer instance for PCM audio data.
Declaration
init?(pcmFormat format: AVAudioFormat, frameCapacity: AVAudioFrameCount)Parameters
- format:
The format of the PCM audio the buffer contains.
- frameCapacity:
The capacity of the buffer in PCM sample frames.
Return Value
A new AVAudioPCMBuffer instance, or nil if it’s not possible.
Discussion
The method returns nil due to the following reasons:
The format has zero bytes per frame.
The system can’t represent the buffer byte capacity as an unsigned bit-32 integer.