anarchuser / mic_stream

Flutter plugin to get an infinite audio stream from the microphone
https://pub.dev/packages/mic_stream
GNU General Public License v3.0
100 stars 68 forks source link

I refer to your code to write the demo, when I click start to start recording, the program will be killed and an error will be reported in the debug console.(Macos) #77

Closed sliderss closed 11 months ago

sliderss commented 11 months ago

I don't know where I didn't set.

2023-09-21 01:31:45.436 audio_demo[75019:15548391] Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required condition is false: IsFormatSampleRateAndChannelCountValid(format)' First throw call stack: ( 0 CoreFoundation 0x0000000192b83154 __exceptionPreprocess + 176 1 libobjc.A.dylib 0x00000001926a24d4 objc_exception_throw + 60 2 CoreFoundation 0x0000000192bacf54 -[NSException description] + 0 3 AVFAudio 0x00000001f9110304 _Z19AVAE_RaiseExceptionP8NSStringz + 52 4 AVFAudio 0x00000001f9133a60 _ZN17AUGraphNodeBaseV318CreateRecordingTapEmjP13AVAudioFormatU13block_pointerFvP16AVAudioPCMBufferP11AVAudioTimeE + 748 5 AVFAudio 0x00000001f91c2284 -[AVAudioNode installTapOnBus:bufferSize:format:block:] + 1400 6 mic_stream 0x00000001040e338c $s10mic_stream20SwiftMicStreamPluginC8onListen13withArguments9eventSinkSo12FlutterErrorCSgypSg_yAJctF + 2288 7 mic_stream 0x00000001040e3f04 $s10mic_stream20SwiftMicStreamPluginC8onListen13withArguments9eventSinkSo12FlutterErrorCSgypSg_yAJctFTo + 228 25 HIToolbox 0x000000019c352a7c ReceiveNextEventCommon + 648 26 HIToolbox 0x000000019c3527d4 _BlockUntilNextEventMatchingListInModeWithFilter + 76 27 AppKit 0x0000000195d29d44 _DPSNextEvent + 636 28 AppKit 0x0000000195d28ee0 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716 29 AppKit 0x0000000195d1d344 -[NSApplication run] + 464 30 AppKit 0x0000000195cf4794 NSApplicationMain + 880 31 audio_demo 0x000000010405db98 main + 12 32 dyld 0x00000001926d3f28 start + 2236 ) libc++abi: terminating due to uncaught exception of type NSException

sliderss commented 11 months ago

Solved the problem