Closed marvpaul closed 1 year ago
I create a new MP4Recorder as suggested in the docs by passing the AudioSettings.outputSampleRate.
The sampleRate
and channelCount
you pass to the MP4Recorder
constructor define the audio format of any audio that you will pass to MP4Recorder.CommitSamples
. Our docs state that when recording audio from Unity Engine (i.e. recording an AudioListener
's audio), then the sample rate should be AudioSettings.outputSampleRate
because that tells the recorder what the sample rate of the audio data coming out of Unity Engine.
This crash is happening because Unity is running at a very high sample rate that isn't supported by iOS' AAC encoder. You have to find a way to limit Unity's audio sample rate to 48KHz or lower.
I create a new MP4Recorder as suggested in the docs by passing the AudioSettings.outputSampleRate.
recorder = new MP4Recorder(recordingWidth, recordingHeight, framerate, AudioSettings.outputSampleRate, 2, videoBitRate: videoBitRate, keyframeInterval: keyframeInt);
On my machine all works fine but one of my customers got a hard crash when trying to record a video and getting this error: