Hi there!
We’ve run into a strange issue with a Samsung Galaxy S10 device. For some reason, RuntimeManager.CoreSystem.getRecordDriverInfo returns a channel count of 2 (stereo). Which shouldn’t be the case, as it doesn’t have a stereo microphone.
I’m trying to force to mono, but the resulting audio is not usable / sample values are 0. This is the code we’re using:
CREATESOUNDEXINFO exinfo = default;
exinfo.cbsize = Marshal.SizeOf(typeof(CREATESOUNDEXINFO));
exinfo.numchannels = 1;
exinfo.format = SOUND_FORMAT.PCMFLOAT;
exinfo.defaultfrequency = deviceSampleRate;
exinfo.length = (uint)(deviceSampleRate * sizeof(float));
var sys = RuntimeManager.CoreSystem;
if (!Check(sys.createSound("recording", MODE.LOOP_NORMAL | MODE.OPENUSER, ref exinfo, out _sound), "Failed to call `createSound`"))
return null;
if (!Check(_sound.getLength(out _soundLength, TIMEUNIT.PCM), "Failed to call `getLength`"))
return null;
if (!Check(_sound.getFormat(out var st, out var sf, out var sc, out var sb), "Failed to call `getFormat`"))
return null;
Log.Debug($"FMOD Recording SoundType:{st} Format:{sf} Channels:{sc} Bits:{sb} freq:{deviceSampleRate}");
// Start recording into the sound buffer
if (!Check(sys.recordStart(_deviceID, _sound, true), "Failed to call `recordStart`"))
return null;
IsRecording = true;
Is this approach correct? Should we try any other settings? The thing is that on this S10 device, other apps are using the device mic just fine. That means to me that there must be an issue with FMOD or our implementation.
Maybe you have an idea what this could be about; and what we should try next. Thank you!