signal SIGABRT error

Hi there,


I am trying to get this example to work that was provided by Apple: https://developer.apple.com/library/content/samplecode/SpeakToMe/Introduction/Intro.html.

However, I am getting a SIGABRT error. I know that this can occur due to a variety of reasons, however, there appears to be no issue in the Storyboard. A couple of things to note, I converted the code to Swift 4 as per the prompts given in XCode 9.3, and I am running the application on an iPhone simulator. The below code is what I receive when the app crashes (the app builds fine but crashes as soon as I press the "Start Recording!" button):


2018-04-12 23:23:36.301018+1000 SpeakToMe[1841:32635] [AudioHAL_Client] AudioHardware.cpp:780:AudioObjectSetPropertyData: AudioObjectSetPropertyData: no object with given ID 0

2018-04-12 23:23:36.307979+1000 SpeakToMe[1841:32635] 80: Failed to set processVolumeScalar on device. Error: 560947818

2018-04-12 23:23:36.614805+1000 SpeakToMe[1841:33719] [AudioHAL_Client] AudioHardware.cpp:875:AudioObjectAddPropertyListenerBlock: AudioObjectAddPropertyListenerBlock: no object with given ID 0

2018-04-12 23:23:36.615067+1000 SpeakToMe[1841:33719] [AudioHAL_Client] AudioHardware.cpp:875:AudioObjectAddPropertyListenerBlock: AudioObjectAddPropertyListenerBlock: no object with given ID 0

2018-04-12 23:23:36.615502+1000 SpeakToMe[1841:33719] [DDAgg] DefaultDeviceAggregate.cpp:737:BuildAggregate: Error finding valid input or output devices!

2018-04-12 23:23:36.616864+1000 SpeakToMe[1841:33719] [aqme] 318: error -66680 finding/initializing AQDefaultDevice

2018-04-12 23:23:36.620992+1000 SpeakToMe[1841:32635] [aurioc] 921: failed: -10851 (enable 1, outf< 2 ch, 0 Hz, Int16, inter> inf< 2 ch, 0 Hz, Int16, inter>)

2018-04-12 23:23:36.621088+1000 SpeakToMe[1841:33700] [AudioHAL_Client] AudioHardware.cpp:2682:AudioDeviceStop: AudioDeviceStop: no device with given ID

2018-04-12 23:23:36.623974+1000 SpeakToMe[2018-04-12 23:23:36.632060+1000 SpeakToMe[1841:32635] [avae] AVAEInternal.h:70:_AVAE_Check: required condition is false: [AVAEGraphNode.mm:810:CreateRecordingTap: (IsFormatSampleRateAndChannelCountValid(format))]

1841:33700] [aqme] 318: error -66680 finding/initializing AQDefaultDevice

2018-04-12 23:23:37.126323+1000 SpeakToMe[1841:33700] 108: * * * NULL AQIONode object

2018-04-12 23:23:37.132218+1000 SpeakToMe[1841:33700] 771: Can't make UISound Renderer

2018-04-12 23:23:37.141160+1000 SpeakToMe[1841:32635] *** Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required condition is false: IsFormatSampleRateAndChannelCountValid(format)'

*** First throw call stack:

(

0 CoreFoundation 0x00000001101c61e6 __exceptionPreprocess + 294

1 libobjc.A.dylib 0x000000010c0f8031 objc_exception_throw + 48

2 CoreFoundation 0x00000001101cb472 +[NSException raise:format:arguments:] + 98

3 AVFAudio 0x0000000111f49f52 _Z19AVAE_RaiseExceptionP8NSStringz + 158

4 AVFAudio 0x0000000111f35de3 _Z11_AVAE_CheckPKciS0_S0_b + 323

5 AVFAudio 0x0000000111ef41b0 _ZN17AUGraphNodeBaseV318CreateRecordingTapEmjP13AVAudioFormatU13block_pointerFvP16AVAudioPCMBufferP11AVAudioTimeE + 234

6 AVFAudio 0x0000000111edec28 _ZN18AVAudioEngineGraph16InstallTapOnNodeEP11AVAudioNodemjP13AVAudioFormatU13block_pointerFvP16AVAudioPCMBufferP11AVAudioTimeE + 218

7 AVFAudio 0x0000000111f481a7 _ZN17AVAudioEngineImpl16InstallTapOnNodeEP11AVAudioNodemjP13AVAudioFormatU13block_pointerFvP16AVAudioPCMBufferP11AVAudioTimeE + 13

8 AVFAudio 0x0000000111f3953e -[AVAudioNode installTapOnBus:bufferSize:format:block:] + 208

9 SpeakToMe 0x000000010b7e7a5e _T09SpeakToMe14ViewControllerC14startRecording33_90ECD45D8527DD04960287C19CFEE024LLyyKF + 1870

10 SpeakToMe 0x000000010b7e960e _T09SpeakToMe14ViewControllerC12buttonTappedySo8UIButtonCF + 1118

11 SpeakToMe 0x000000010b7e98ac _T09SpeakToMe14ViewControllerC12buttonTappedySo8UIButtonCFTo + 60

12 UIKit 0x000000010ce02448 -[UIApplication sendAction:to:from:forEvent:] + 83

13 UIKit 0x000000010cf7d804 -[UIControl sendAction:to:forEvent:] + 67

14 UIKit 0x000000010cf7db21 -[UIControl _sendActionsForEvents:withEvent:] + 450

15 UIKit 0x000000010cf7ca69 -[UIControl touchesEnded:withEvent:] + 580

16 UIKit 0x000000010ce7711f -[UIWindow _sendTouchesForEvent:] + 2729

17 UIKit 0x000000010ce78821 -[UIWindow sendEvent:] + 4086

18 UIKit 0x000000010ce1c370 -[UIApplication sendEvent:] + 352

19 UIKit 0x000000010d75d57f __dispatchPreprocessedEventFromEventQueue + 2796

20 UIKit 0x000000010d760194 __handleEventQueueInternal + 5949

21 CoreFoundation 0x0000000110168bb1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17

22 CoreFoundation 0x000000011014d4af __CFRunLoopDoSources0 + 271

23 CoreFoundation 0x000000011014ca6f __CFRunLoopRun + 1263

24 CoreFoundation 0x000000011014c30b CFRunLoopRunSpecific + 635

25 GraphicsServices 0x0000000114664a73 GSEventRunModal + 62

26 UIKit 0x000000010ce010b7 UIApplicationMain + 159

27 SpeakToMe 0x000000010b7eb317 main + 55

28 libdyld.dylib 0x0000000111449955 start + 1

)

libc++abi.dylib: terminating with uncaught exception of type NSException

(lldb)


Anyone have any ideas? It's stumped me for far too long. Cheers.

Sorry, but I cannot reproduce the same issue as yours.


I downloaded the latest sample code (Version 1.0, 2016-09-13).


Opened it with Xcode 9.3 and converted it to Swift 4, Xcode said no changes required but I needed to fix one line:

guard let inputNode = audioEngine.inputNode else { fatalError("Audio engine has no input node") }

To:

let inputNode = audioEngine.inputNode


Set Swift 3 @objc inference to Off for both the project and the target.


And ran it on the iPhone 7 plus simulator (iOS 11.3), pressed the Start Recording! button...


Worked fine. No exceptions, no console outputs. (Though, the app could not write down my English properly...)


Can you try to clarify the conditions to reproduce the issue?

signal SIGABRT error
 
 
Q