multi-audioChannel test
This commit is contained in:
1 parent
a799c39aff
commit
cf11b06f3e
1 file changed
+8
-1
@@ -290,10 +290,11 @@ int ArInit(int audioConfiguration, POPUS_MULTISTREAM_CONFIGURATION opusConfig, v
|
|||||||
TemporarySettings* tempSettings = [dataMan getSettings];
|
TemporarySettings* tempSettings = [dataMan getSettings];
|
||||||
bool useBluetoothD2P = tempSettings.useBuiltinMic || !tempSettings.redirectMic;
|
bool useBluetoothD2P = tempSettings.useBuiltinMic || !tempSettings.redirectMic;
|
||||||
AVAudioSessionCategoryOptions bluetoothAudioOption = useBluetoothD2P ? AVAudioSessionCategoryOptionAllowBluetoothA2DP : AVAudioSessionCategoryOptionAllowBluetooth;
|
AVAudioSessionCategoryOptions bluetoothAudioOption = useBluetoothD2P ? AVAudioSessionCategoryOptionAllowBluetoothA2DP : AVAudioSessionCategoryOptionAllowBluetooth;
|
||||||
|
AVAudioSessionCategoryOptions audioMixOption = opusConfig->channelCount > 2 ? 0 : AVAudioSessionCategoryOptionMixWithOthers;
|
||||||
AVAudioSession *session = [AVAudioSession sharedInstance];
|
AVAudioSession *session = [AVAudioSession sharedInstance];
|
||||||
[session setCategory:tempSettings.redirectMic ? AVAudioSessionCategoryPlayAndRecord : AVAudioSessionCategoryPlayback
|
[session setCategory:tempSettings.redirectMic ? AVAudioSessionCategoryPlayAndRecord : AVAudioSessionCategoryPlayback
|
||||||
mode:AVAudioSessionModeDefault
|
mode:AVAudioSessionModeDefault
|
||||||
options:AVAudioSessionCategoryOptionMixWithOthers|AVAudioSessionCategoryOptionDefaultToSpeaker|bluetoothAudioOption
|
options:audioMixOption|AVAudioSessionCategoryOptionDefaultToSpeaker|bluetoothAudioOption
|
||||||
error:nil];
|
error:nil];
|
||||||
if(tempSettings.redirectMic) if(@available(iOS 13.0, *)) [session setAllowHapticsAndSystemSoundsDuringRecording:YES error:nil];
|
if(tempSettings.redirectMic) if(@available(iOS 13.0, *)) [session setAllowHapticsAndSystemSoundsDuringRecording:YES error:nil];
|
||||||
[session setActive:YES error:nil];
|
[session setActive:YES error:nil];
|
||||||
@@ -371,6 +372,12 @@ void AudioEngineInit(int sampleRate, int channelCount) {
|
|||||||
|
|
||||||
if(!audioFormat) return;
|
if(!audioFormat) return;
|
||||||
|
|
||||||
|
AVAudioFormat *mixerFormat = [audioEngine.mainMixerNode outputFormatForBus:0];
|
||||||
|
AVAudioFormat *outputFormat = [audioEngine.outputNode inputFormatForBus:0];
|
||||||
|
NSLog(@"Mixer: %dch, Output: %dch",
|
||||||
|
(int)mixerFormat.channelCount,
|
||||||
|
(int)outputFormat.channelCount);
|
||||||
|
|
||||||
[audioEngine connect:audioPlayerNode to:audioEngine.mainMixerNode format:audioFormat];
|
[audioEngine connect:audioPlayerNode to:audioEngine.mainMixerNode format:audioFormat];
|
||||||
|
|
||||||
NSError *err = nil;
|
NSError *err = nil;
|
||||||
|
|||||||
Reference in new issue
Block a user