Question about audio loop

78 views
Skip to first unread message

Vladimir B

unread,
Dec 4, 2025, 6:56:23 AM (8 days ago) Dec 4
to baresip
Hello, iam start using Baresip recently. I have a question about audio loop. I used baresip like a client to connect to my audio server, all works fine and i can send some wav file and check it on server. But i need to loop this wav file for its played in a circle. How i can do that? I heard that in previos versions it was possible with settings like:  avformat_stream_loop 1
so i need some help with that if its possible.....

my config:

 baresip configuration
#

#------------------------------------------------------------------------------

# SIP
#sip_listen             0.0.0.0:5060
#sip_certificate        cert.pem
sip_cafile              /etc/ssl/certs/ca-certificates.crt
sip_capath              /etc/ssl/certs
#sip_transports         udp,tcp,tls,ws,wss
#sip_trans_def          udp
#sip_verify_server      yes
#sip_verify_client      no
#sip_tls_resumption     all
sip_tos                 160
#filter_registrar       udp,tcp,tls,ws,wss

# Call
call_local_timeout      120
call_max_calls          4
call_hold_other_calls   yes
call_accept             no

# Audio
#audio_path             /usr/local/share/baresip
#audio_player           alsa,default
audio_source            aufile,/home/borovskii/Downloads/sample.wav
#audio_source           aufile,/home/borovskii/Downloads/poisonruin.mp3
#audio_alert            alsa,default
ausrc_srate             48000
#auplay_srate           48000
ausrc_channels          2
#auplay_channels        0
#audio_txmode           poll            # poll, thread
#audio_level            no
#ausrc_format           s16             # s16, float, ..
#auplay_format          s16             # s16, float, ..
#auenc_format           s16             # s16, float, ..
#audec_format           s16             # s16, float, ..
#audio_buffer           20-160          # ms
#audio_buffer_mode      fixed           # fixed, adaptive
#audio_silence          -35.0           # in [dB]
#audio_telev_pt         101             # payload type for telephone-event

# Video
#video_source           v4l2,/dev/video
#video_source           h.264,/home/borovskii/Documents/baresip/IAmLegendTrailerFullHD.h264
#video_display          x11,nil
#video_size             1920x1080
#video_bitrate          4009600
#video_fps              30.00
#video_fullscreen       yes
#videnc_format          yuv420p
#videnc_format          libx264

# AVT - Audio/Video Transport
rtp_tos                 184
rtp_video_tos           136
#rtp_ports              10000-20000
#rtp_bandwidth          512-1024 # [kbit/s]
audio_jitter_buffer_type        fixed           # off, fixed, adaptive
audio_jitter_buffer_ms  100-200         # Min. - Max. [ms]
audio_jitter_buffer_size        50              # [packets]
video_jitter_buffer_type        fixed           # off, fixed, adaptive
video_jitter_buffer_ms  100-200         # Min. - Max. [ms]
video_jitter_buffer_size        250             # [packets]
rtp_stats               no
#rtp_timeout            60
#avt_bundle             no
#rtp_rxmode             main

Vladimir B

unread,
Dec 4, 2025, 7:22:08 AM (8 days ago) Dec 4
to baresip
and if i remember correct it was libraris nemed auloop.so and vidloop.so in previous versions.......
четверг, 4 декабря 2025 г. в 14:56:23 UTC+3, Vladimir B:

Alfred E. Heggestad

unread,
Dec 4, 2025, 8:31:42 AM (8 days ago) Dec 4
to Vladimir B, baresip
Hi

Please try this module:

https://github.com/baresip/baresip-apps/tree/main/modules/auloop




Alfred

On 04/12/2025 13:22, Vladimir B wrote:
> and if i remember correct it was libraris nemed auloop.so and vidloop.so
> in previous versions.......
> четверг, 4 декабря 2025 г. в 14:56:23 UTC+3, Vladimir B:
>
> Hello, iam start using Baresip recently. I have a question about
> audio loop. I used baresip like a client to connect to my audio
> server, all works fine and i can send some wav file and check it on
> server. But i need to loop this wav file for its played in a circle.
> How i can do that? I heard that in previos versions it was possible
> with settings like:  avformat_stream_loop 1
> so i need some help with that if its possible.....
>
> my config:
>
>  baresip configuration
> #
>
> #------------------------------------------------------------------------------
>
> # SIP
> #sip_listen 0.0.0.0:5060 <http://0.0.0.0:5060>
> --
> You received this message because you are subscribed to the Google
> Groups "baresip" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to baresip+u...@googlegroups.com
> <mailto:baresip+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/baresip/
> e9b1dd4b-f668-4115-b6e8-a383f5499962n%40googlegroups.com <https://
> groups.google.com/d/msgid/baresip/e9b1dd4b-f668-4115-b6e8-
> a383f5499962n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Vladimir B

unread,
Dec 4, 2025, 8:41:53 AM (8 days ago) Dec 4
to baresip
Can u plz tell me more details). If i understand correct first off all i need to install this module? And how i can do that?


четверг, 4 декабря 2025 г. в 16:31:42 UTC+3, alfred.h...@gmail.com:

Vladimir B

unread,
Dec 4, 2025, 9:02:09 AM (8 days ago) Dec 4
to baresip

Iam download https://github.com/baresip/baresip-apps unpack it and just make:

$ cd baresip $ cmake -B build $ cmake --build build $ cmake --install build

 now i have in my /usr/local/baresip/modules/auloop.so, vidloop.so

am i correct?



четверг, 4 декабря 2025 г. в 16:41:53 UTC+3, Vladimir B:

Vladimir B

unread,
Dec 4, 2025, 9:45:49 AM (8 days ago) Dec 4
to baresip
ok, its look like auloop is added

                    ESC      Hangup call
  /100rel ..                   Set 100rel mode
  /about                       About box
  /accept             a        Accept incoming call
  /acceptdir ..                Accept incoming call with audio and videodirection.
  /addcontact ..               Add a contact
  /answermode ..               Set answer mode
  /apistate                    User Agent state
  /aufileinfo ..               Audio file info
  /auloop ..                   Start audio-loop <srate ch>
  /auloop_stop                 Stop audio-loop
  /auplay ..                   Switch audio player
  /ausrc ..                    Switch audio source
  /callstat           c        Call status
  /conf_reload                 Reload config file
  /config                      Print configuration
  /contact_next       >        Set next contact
  /contact_prev       <        Set previous contact
  /contacts           C        List contacts
  /dial ..            d ..     Dial
  /dialcontact        D        Dial current contact
  /dialdir ..                  Dial with audio and videodirection.
  /dnd ..                      Set Do not Disturb
  /entransp ..                 Enable/Disable transport
  /hangup             b        Hangup call
  /hangupall ..                Hangup all calls with direction
  /help               h        Help menu
  /insmod ..                   Load module
  /listcalls          l        List active calls
  /loglevel           v        Log level toggle
  /main                        Main loop debug
  /memstat            y        Memory status
  /message ..         M ..     Message current contact
  /modules                     Module debug
  /netchange                   Inform netroam about a network change
  /netstat            n        Network debug
  /options ..         o ..     Options
  /play ..                     Play audio file
  /quit               q        Quit
  /refer ..           R ..     Send REFER outside dialog
  /reginfo            r        Registration info
  /rmcontact ..                Remove a contact
  /rmmod ..                    Unload module
  /setadelay ..                Set answer delay for outgoing call
  /setansval ..                Set value for Call-Info/Alert-Info
  /sipstat            i        SIP debug
  /siptrace ..                 SIP trace
  /sysinfo            s        System info
  /timers                      Timer debug
  /tlsissuer                   TLS certificate issuer
  /tlssubject                  TLS certificate subject
  /uaaddheader ..              Add custom header to UA
  /uadel ..                    Delete User-Agent
  /uadelall ..                 Delete all User-Agents
  /uafind ..                   Find User-Agent <aor>
  /uanew ..                    Create User-Agent
  /uareg ..                    UA register <regint> [index]
  /uarmheader ..               Remove custom header from UA
  /uastat             u        UA debug
  /uuid                        Print UUID
  /vidsrc ..                   Switch video source


/auloop
Usage: /auloop <samplerate> <channels>

But how i can use it? what means samplerate and channels?
четверг, 4 декабря 2025 г. в 17:02:09 UTC+3, Vladimir B:

Vladimir B

unread,
Dec 4, 2025, 10:07:32 AM (8 days ago) Dec 4
to baresip
Ok i used rate and channels but for some reason the loop is stop with this error:

/auloop <48000 2>
Audio-loop: 48000Hz, 2ch, S16LE
alsa: reset: srate=48000, ch=2, num_frames=960, pcmfmt=S16_LE
alsa: playback started (default)
aufile: loading input file '/home/borovskii/Downloads/sample.wav'
aufile: /home/borovskii/Downloads/sample.wav: 8000 Hz, 1 channels, S16LE
aufile: audio ptime=20 sampc=160
aufile: read end of file
aufile: loaded 150400 bytes
aufile: end of filen_read=0.776 n_write=9.400 rw_delay=-8.623 [sec] rw_ratio=0.082624          
auloop: ausrc error: Success [0] (end of file)
~~~~~ Audioloop summary: ~~~~~
48000 Hz 2ch S16LE

* Source
  module      aufile
  samples     75200
  duration    0.783 sec
  frames      470 (avg ptime 1.66ms)

* Aubuf
  overrun     0
  underrun    437

alsa: stopping playback thread (default)
* Player
  module      alsa
  samples     908160
  duration    9.460 sec
  frames      473 (avg ptime 20.00ms)

четверг, 4 декабря 2025 г. в 17:45:49 UTC+3, Vladimir B:

Vladimir B

unread,
Dec 4, 2025, 10:56:23 AM (8 days ago) Dec 4
to baresip
but if there is no any files to loop it works ok...

/auloop <48000 2>
Audio-loop: 48000Hz, 2ch, S16LE
alsa: reset: srate=48000, ch=2, num_frames=960, pcmfmt=S16_LE
alsa: playback started (default)
alsa: reset: srate=48000, ch=2, num_frames=960, pcmfmt=S16_LE
alsa: recording started (default) format=S16LE
48000Hz 2ch  S16LE  n_read=114.159 n_write=114.299 rw_delay=-0.140 [sec] rw_ratio=0.998775

четверг, 4 декабря 2025 г. в 18:07:32 UTC+3, Vladimir B:
Reply all
Reply to author
Forward
0 new messages