Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

448
Vistas
AVAudioPlayer playing sound with very low volume when WebRTC audio call in progress

I am attempting to play a sound clip using AVAudioPlayer while having an active PeerConnection using the GoogleWebRTC Obj-C library for iOS.

When I play the sound, I can hear it through the speakers, but it plays at an extremely low (almost inaudible) volume in comparison with the WebRTC Audio output.

I have AVAudioSession set to active = true with the following; AVAudioSession.Category = .playAndRecord, AVAudioSession.CategoryOptions = [.defaultToSpeaker, .allowBluetooth, .mixWithOthers], AVAudioSession.Mode = .voiceChat.

I have no trouble playing and hearing sounds when there is not an actively configured WebRTC audio connection.

Is there a way to allow sound to play from an AVAudioPlayer without it being lowered in volume via WebRTC?

do {
        try setActiveAudio()

        let player = try AVAudioPlayer(data: asset.data, fileTypeHint: AVFileType.mp3.rawValue)

        activePlayers.append(player)

        player.delegate = self
        player.prepareToPlay()
        player.play()
} catch let error {
        print(error.localizedDescription)
}

Thank you for any help.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Before play audio, change mode to default, also will lost aec, agc support,

[[AVAudioSession sharedInstance] setMode:AVAudioSessionModeDefault error:&error];

when finish play, reset mode to voice chat,

[[AVAudioSession sharedInstance] AVAudioSessionModeVoiceChat error:&error];
over 4 years ago · Santiago Trujillo Denunciar

0

I have faced somewhat similar issue, when the ringer is off. Can you

  1. Make sure the ringer is not off
  2. Make sure the current output port is speaker.

    [[AVAudioSession sharedInstance] overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:nil];
    
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda