tSIP softphone: audio device switching

Input and output audio device switching during call was added (following baresip) in tSIP 0.1.51.

Two new button types were added - one switching output device and one for input device. Each button instance (for switching back and forth between different devices) specifies audio module used (Portaudio, winwave or in case of input selection: wave file) and particular device (or wave file) to switch to.

Switching audio outputs

tSIP audio device switching
Three buttons defined, each one with separate output device (SPDIF / speakers / extra USB sound card).
Audio switching button settings

Switching audio sources

As of 2024, for each tSIP release there are two separate binaries: with and without ("basic") video support.

Basic version allows switching audio source to selected physical device (microphone or line input), silence/nullaudio (slightly redundant considering there is also Mute button) or wave file. For wave files PCM S16LE or G.711 mono format is required. Wave files are resampled when reading, but to keep their size minimal they should match best codec to be used, e.g. 16000 sps for G.722. Handling end-of-file might attention - it is treated as audio error and in default configuration it would disconnect the call. If this is not the desired behavior, there is a setting to ignore end-of-file allowing to handle it with script like in playing audio files example.

Version with video contains additional FFmpeg-based avformat input module with very wide audio format compatibility. It can play mp3, audio track from mp4, ogg, aac and even http-based internet radio stations. Note that with current tSIP version (0.3.05) there is one major difference from module playing wav files (aufile) - with avformat file is looped when end-of-file is reached.

Usually one of the buttons would be configured to switch back to default audio device. To avoid duplicating device configuration (one in Settings window, one in button configuration) Lua SwitchAudioSourceToConfigured() function can be used.

Use cases

Back to tSIP softphone