k2-fsa / sherpa-ncnn

Real-time speech recognition using next-gen Kaldi with ncnn without Internet connection. Support iOS, Android, Raspberry Pi, VisionFive2, LicheePi4A etc.
https://k2-fsa.github.io/sherpa/ncnn/index.html
Apache License 2.0
891 stars 138 forks source link

ios IsFormatSampleRateAndChannelCountValid 错误 #337

Closed willdla closed 1 month ago

willdla commented 1 month ago
image image

如图 模拟器运行时会遇到这个错误

https://stackoverflow.com/questions/74516660/ios-app-crashes-with-required-condition-is-false-isformatsamplerateandchannelc

https://stackoverflow.com/questions/60984704/required-condition-is-false-isformatsamplerateandchannelcountvalidformat

谷歌查到的答案云里雾里的..

难道要有真机才可以

大佬知道怎么修复吗

csukuangfj commented 1 month ago

我在模拟器里,就可以运行的。你可以看 b 站我们的演示视频。

ios 录音这块,需要你自己解决了。我们对 ios 的开发经验不多。

willdla commented 1 month ago
image

加一行这个就可以让模拟器跑起来了 但是貌似没法录音

系统没提示有设备在使用录音

xcode 上显示

       AURemoteIO.cpp:1162  failed: -10851 (enable 1, outf< 2 ch,      0 Hz, Float32, deinterleaved> inf< 2 ch,      0 Hz, Float32, deinterleaved>)

点击start后

 AURemoteIO.cpp:1162  failed: -10851 (enable 1, outf< 2 ch,      0 Hz, Float32, deinterleaved> inf< 2 ch,      0 Hz, Float32, deinterleaved>)

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

Got an error starting audioEngine: com.apple.coreaudio.avfaudio, Error Domain=com.apple.coreaudio.avfaudio Code=-10851 "(null)" UserInfo={failed call=err = AUGraphParser::InitializeActiveNodesInInputChain(ThisGraph, *GetInputNode())}

ios好垃圾啊 调用个录音都这么麻烦