speechly / ios-client

The iOS client library for Speechly API
MIT License
65 stars 5 forks source link

AVAudioEngine error #8

Closed aswyer closed 2 years ago

aswyer commented 2 years ago

Describe the bug

AVAudioEngine error after calling client.startContext()

AVAEInternal.h:109 [AVAudioEngineGraph.mm:1397:Initialize: (err = AUGraphParser::InitializeActiveNodesInInputChain(ThisGraph, *GetInputNode())): error -10868

AVAudioEngine.mm:167 Engine@0x2835ec560: could not initialize, error = -10868

Errors are shown after

  1. Client init
  2. After audioEngine.prepare() is called in AudioRecorder.swift. Errors are reported to the delegate by line 441 of Client.swift.

Only happens on device... everything works as expected in simulator.

Steps to reproduce

Occurs after Client init and again after calling client.startContext().

Environment

aswyer commented 2 years ago

Was able to resolve by running AVAudioSession.sharedInstance().setCategory(.playAndRecord) before creating Speechly client. Unsure why this only caused issues on device & not in simulator.