[VisionOS Audio] AVAudioPlayerNode occasionally produces loud popping/distortion when playing PCM data

I'm experiencing audio issues while developing for visionOS when playing PCM data through AVAudioPlayerNode.

Issue Description:

  • Occasionally, the speaker produces loud popping sounds or distorted noise
  • This occurs during PCM audio playback using AVAudioPlayerNode
  • The issue is intermittent and doesn't happen every time

Technical Details:

  • Platform: visionOS
  • Device: vision pro / simulator
  • Audio Framework: AVFoundation
  • Audio Node: AVAudioPlayerNode
  • Audio Format: PCM

I would appreciate any insights on:

  1. Common causes of audio distortion with AVAudioPlayerNode
  2. Recommended best practices for handling PCM playback in visionOS
  3. Potential configuration issues that might cause this behavior

Has anyone encountered similar issues or found solutions? Any guidance would be greatly helpful.

Thank you in advance!

Hello @_rdy, thank you for your post. Do you get the same results with just the relevant code in a small test project? If so, please share a link to your test project. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project.

I don't know if this will help, but I had a similar issue when converting my buffers to what my player node expected. My customer converter block was wrong, and it was giving too much data in the conversion process creating the same effect you described

[VisionOS Audio] AVAudioPlayerNode occasionally produces loud popping/distortion when playing PCM data
 
 
Q