Android Tutorial [B4X] Simple audio call over internet with own TURN/relay server

omarruben

Active Member
Licensed User
Longtime User
do you have an example for B4j? thank you
 

Biswajit

Active Member
Licensed User
Longtime User
do you have an example for B4j? thank you
Don't use this method (socket.io) for VoIP calling. After some research I found that this is very slow compared to webrtc.
 

Jmu5667

Well-Known Member
Licensed User
Longtime User
Is there a full version of this availble to test ? Is source provided with paid version ?
 

Biswajit

Active Member
Licensed User
Longtime User
Is there a full version of this availble to test ? Is source provided with paid version ?
No, actually I haven't continued this project as I was facing many difficulties so now I'm trying this to implement with webrtc. Once done, will post it here.
 

Ahmet KOÇ

Member
Licensed User
There was a sound echo problem on the Android device during the call between IOS and Android. I fixed it by changing it like this.

Use this AVAudioSessionCategoryOptionMixWithOthers value instead of the AVAudioSessionCategoryOptionDefaultToSpeaker value.

B4X:
-(bool) SetAudioSessionInCall:(bool)enable{
    AVAudioSession *audioSession = [AVAudioSession sharedInstance];
    NSError *err = nil;
    BOOL success;
    if(enable){
        success = [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord mode:AVAudioSessionModeVoiceChat options:AVAudioSessionCategoryOptionMixWithOthers error:&err];
    }else{
        success = [audioSession setCategory:AVAudioSessionCategoryPlayback mode:AVAudioSessionModeDefault options:nil error:&err];
    }
    if (success) {
        success = [audioSession setActive:YES error:&err];
    }
    if (!success) [NSException raise:mad:"" format:mad:"Error setting audio session: %@", err];
    return success;
}
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…