-
-
Notifications
You must be signed in to change notification settings - Fork 20.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AudioStreamMicrophone is broken on iOS hardware #33885
Comments
Fixed in master, but is not backported to 3.1.2.
We already have if (GLOBAL_GET("audio/enable_audio_input")) {
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
} else {
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil];
}
What's input audio format on iOS devices? On macOS Godot's audio recording works with the external microphone connected via 3.5 mm jack (24-bit int, 44.1 kHz), but not with virtual Background Music inputs (32-bit float, 48.0 kHz). |
I guess nobody fixed this problem yet, so I made a pull request because I need to resolve this as soon as possible. |
II have the same problem. I have a program that records audio with the microphone and then plays it back. It works perfectly on all operating systems except when I export it to iOS |
@zarmath You can test my pull request here if you want to. You can modify a few files and follow this instruction. Then the .a files for the iPhone export template will come out. And then, you can download the latest official iPhone export template, replace .a files in it, and copy the zip file to /Users/username/Library/Application Support/Godot/templates/the_version/. That's all. |
Can’t record on iOS Microphone on macOS |
@erikandershed My suggestion is don't use godot in order to use iPhone microphone recording. I realized the recording quality was also poor after I fixed the bug. I fixed a lot to make godot able to achieve the same quality compared to basic iOS microphone recording examples. You can check my repository here. It's quite a mess, and it includes other things not related to the iOS recording. Plus, you will have to rebuild godot. The manuel of it was not clear, so I had to struggle so much. I don't recommend it for your mental health. |
@taeyoonwf I am designen a game where the sound quality is not importent. Is there a way for me to get a zip of the done build Godot. I have no idea how to do this from your repository. Please |
@erikandershed Even I have never made a build of version 3.3.4. As far as I know, the export template and the tool must have the same version, so the only way to make a successful iOS export is that you fork and fix Godot source by yourself. I'm so sorry to say this, but it's true. Besides, the recording quality was not the only issue. The recorded wave source will have random high pitch noises quite often. I gave up fixing the issue by myself and made a new recording method instead. Good luck. |
@taeyoonwf aa ok. Big thanks to you for taking the time to answer to my question. |
We developed an iOS Audio Godot plugin named AudiosPlugin that solves this issue. Please see our GitHub repo: |
I developed a Godot iOS plugin that solves the Godot audio recording issue and playback issue in iOS devices. Please see the GitHub repo: https://github.com/audiosdev/AudiosPlugin-Godot-iOS-Audio-Plugin/ Thanks! |
Is this still reproducible in 4.0 RC 3 or later? |
I can reproduce this in 4.2 on iOS. |
Godot version:
v3.1.1.stable.official
OS/device including version:
iOS 13.1
Issue description:
The audio input (Microphone) on iOS hardware does not work. It works on the simulator.
There are three separate issues causing this:
no microphone permission string in info.plist in XCode export by default (already reported in issue iOS export does not declare microphone permission #30307)
the incorrect AVAudioSession.AudioSessionCategory is set at startup in app_delegate.mm. It works when changed to AVAudioSessionCategoryPlayAndRecord, ie:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
Maybe this should be configurable from the Godot export settings, or inferred from the sound bus usage?
a "-50" error from AudioUnitRender in audio_driver_coreaudio.cpp whenever microphone input is enabled. This is because bufferList.mBuffers[0].mDataByteSize is too small, since there is a mismatch between the capture buffer format and the audio device.
Steps to reproduce:
Minimal reproduction project:
This project will trigger it on iOS hardware (but works fine on the simulator). You may need to unmute audio on the "Record" bus, so that audio is input and output simultaneously:
https://github.com/godotengine/godot-demo-projects/tree/master/audio/mic_record
The text was updated successfully, but these errors were encountered: