Closed original-curtain closed 10 months ago
the record permission is granted
Hello. Can you please provide any logs you have? I haven't been able to test the capturable sound waves on iOS because I don't have that device at the moment, but if you can provide me with any logs that would be great.
To clarify, have you added NSMicrophoneUsageDescription
to the AdditionalPlistData
field in Unreal Engine? The DefaultEngine.ini
file should have the following line (RuntimeAudioImporter is written just for consistency):
AdditionalPlistData=<key>NSMicrophoneUsageDescription</key><string>RuntimeAudioImporter</string>
Hello.NSMicrophoneUsageDescription has added.
And I'm not sure if the fellowing log is what you want.The log is in Xcode. log.txt
By the way,I'm facing same issue when I use UE's Audio capture.As shown below:
When I first recording phone no response.On the second attempt, the phone crashed.That crash is in [File:./Runtime/AudioCaptureImplementations/IOS/AudioCaptureAudioUnit/Private/AudioCaptureAudioUnit.cpp] [Line: 165]
I think the following code also needs to be executed before capturing for iOS, can you test that please?
[[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {
// It might make sense to check the result here
}];
For example you could add the following function declaration to CapturableSoundWave.h:
UFUNCTION(BlueprintCallable, Category = "Capturable Sound Wave|Permissions")
void RequestCapturePermissions();
And the following function definition to CaptureableSoundWave.cpp:
void UCapturableSoundWave::RequestCapturePermissions()
{
#if PLATFORM_IOS
[[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {
// It might make sense to check the result here
}];
#endif
}
And revoke this function beforehand.
The permission is granted.
Only when in case AVAudioSessionRecordPermissionGranted,I'll start capture audio
@gtreshchev T_T I have the same problem on my iphone too And also on my M1, the first record can play sound, but the second-time record doesn't playback. I just notice that the second time I press key to record, there is no log about PCM data, but on my windows, the PCM data always appears when I press record button.
@original-curtain Hello, do you make it work in IOS finally? ^_^
Sorry,I'm not make it work
@original-curtain I found that "Cross-Platform Voice Chat Pro" plugin can work in IOS, you can find the blog in https://blog.csdn.net/qq_31042143/article/details/129479405?spm=1001.2014.3001.5501 BTW, Are you Chinese? Me too ^_^
对啊 不过老哥 你这插件收费,目前我是通过调ios原生方法来实现录音的,只不过最后播放录音还是有问题 orz
@original-curtain 我查到的方法也是说要写原生插件。前几天三折,我买了这个Pro插件,哈哈;看了一下源码,他在UE里面直接调用AVFoundation.h,然后写了语音功能,没有用XCode去封装库调用;俺先研究研究 orz
@1165048017 (抱拳
@1165048017 @original-curtain this support should have been added since commit bc628baf25206b294f5bfa8e8d779eeda5bc85d3. Please reopen this ticket if the issue still persists.
Hello! When I try capture sound in iphone,the return value is always false. I'm use UE5.1 and iphone 13,phone system is 16.3.1![image](https://user-images.githubusercontent.com/26478017/229279223-5cefd8a4-c5ff-4483-ae8e-32f633584f79.png)