MEMixerChannel.cpp:1577 Spatialization not supported on this platform (err=-4)
Asked Answered
I

1

6

I'm playing a sound in my watch only app, but every time the sound plays the debugger shows an error: "MEMixerChannel.cpp:1577 Spatialization not supported on this platform (err=-4)"

Anyone have an idea why ? Is it because I'm developing for WatchOS ?

The manager responsible for playing the sound:

import Foundation
import AVFoundation

final class SoundManager {
    
    var player: AVAudioPlayer?
    
    func playSound(name: String, volume: Float = 1.0) {
        if let url = Bundle.main.url(forResource: name, withExtension: "aif") {
            
            do {
                player = try AVAudioPlayer(contentsOf: url)
                player?.prepareToPlay()
                player?.setVolume(volume, fadeDuration: 0.5)
            } catch {
                print("Error getting the audio file: \(error.localizedDescription)")
            }
        }
        
        player?.play()
    }
}
Immunology answered 24/4, 2022 at 6:41 Comment(1)
Getting the same thing here except slightly different line number "MEMixerChannel.cpp:1579 Spatialization not supported on this platform (err=-4)", whenever the AVAudioPlayer is played for the first time and then intermittently after that, also when stopping sometimes as well, not a big issue as the sound still works but would be nice to know why its doing it?Karyolysis
W
2

It is because you are developing for Apple Watch.

If you look at the "Spatialization Algorithms" on the developer site you will see that WatchOS is not included in the "Availability" for any of the cases.

https://developer.apple.com/documentation/audiounit/audio_unit_properties/spatialization_algorithms

More detailed ways of playing audio allow you to remove that option but regular AVPlayer doesn't seem to have anything.

https://developer.apple.com/documentation/arkit/usdz_schemas_for_ar/actions_and_triggers/audioaction/auralmode

Wellington answered 18/5, 2022 at 16:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.