簡體   English   中英

撥叫應用到電話通話為什么在建立通話之前不能將揚聲器設置為啟用狀態?

[英]sinch calling app-to-phone why can't i set speaker enabled before call is established?

我正在使用sinch iOS SDK。 我希望在呼叫連接時默認設置揚聲器,這樣揚聲器也會在揚聲器上聽到,但是這不可能通過sinchClient.audioController().enableSpeaker()因為只能在callDidEstablish中調用電話接聽后。 因此,振鈴總是通過設備而不是揚聲器發出。 我通過自己操縱AVAudioSession解決了這個問題。 但我不明白為什么存在這種限制?

它應該在揚聲器上播放,您是否從我們的示例應用程序中得到了相同的錯誤?

- (id<SINAudioController>)audioController {
  return [[(AppDelegate *)[[UIApplication sharedApplication] delegate] client] audioController];
}

- (void)setCall:(id<SINCall>)call {
  _call = call;
  _call.delegate = self;
}

#pragma mark - UIViewController Cycle

- (void)viewDidLoad {
  [super viewDidLoad];

  if ([self.call direction] == SINCallDirectionIncoming) {
    [self setCallStatusText:@""];
    [self showButtons:kButtonsAnswerDecline];
    [[self audioController] startPlayingSoundFile:[self pathForSound:@"incoming.wav"] loop:YES];
  } else {
    [self setCallStatusText:@"calling..."];
    [self showButtons:kButtonsHangup];
  }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM