Simulating a poor VOIP call (dropped frames)

Effects, Recipes, Interfacing with other software, etc.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
sgx2
Posts: 6
Joined: Mon Aug 21, 2017 9:56 pm
Operating System: OS X 10.6 Snow Leopard or earlier

Simulating a poor VOIP call (dropped frames)

Post by sgx2 » Mon Aug 21, 2017 10:00 pm

Greetings, Audaciteers!

I am working on a network QoS lesson for my students, and I thought it would be a good demonstration to show the effect of congestion and dropped frames on a VOIP call. I immediately thought of using Audacity on a sound sample to simulate various stages of signal issues -- but I don't really know how to go about this.

Does this group have any suggestions of filters I can use for this purpose? Again, this is meant to be demonstrative, not 100% accurate...

Thanks!
SGx2

kozikowski
Forum Staff
Posts: 69374
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Simulating a poor VOIP call (dropped frames)

Post by kozikowski » Tue Aug 22, 2017 7:57 pm

I don't know about dropped frames. What happens with natural speech is the system senses a restriction in the data rate and the data processing gets stiffer to try and make up the difference. That's when it sounds like talking into a wine glass or milk jug. Then it sometimes snaps back to normal and leaves out a portion of a word or includes a garbled word. Anybody with a stand-alone microphone and a wine glass and milk jug can simulate this. Record the dialog multiple times and switch between them.

Don't try that on one track. Use multiple tracks (top to bottom) and switch between them with clever editing or Time Shift Tool (two sideways black arrows) and Envelope Tool.

http://manual.audacityteam.org/man/envelope_tool.html

Koz

steve
Site Admin
Posts: 81629
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Simulating a poor VOIP call (dropped frames)

Post by steve » Tue Aug 22, 2017 11:36 pm

Here's a little script that can be run in the Nyquist Prompt effect.
It should only be used with fairly short mono tracks.

What it does is to split the selected audio into "frames" that have as size of "Frame size (samples)"
Then it drops a random number between 0 and "Max dropped samples" from the end of the frame.
There is also an option to either "Delete" the dropped samples, which makes the overall audio shorter, or replace the dropped samples with silence.

Code: Select all

;version 4
;type process

;control max-frame-size "Frame size (samples)" int "" 400 110 4410
;control max-drop-samples "Max dropped samples" int "" 20 0 100
;control mode "Dropped samples are" choice "Deleted,Silenced" 0

(defun drop-samples (sig)
  (let ((out (s-rest 0)))
    ;First frame must be max size
    (do* ((T0 0 (+ T0 (if (= mode 0) frame-size max-frame-size)))
          (frame-size max-frame-size
                      (- max-frame-size (random max-drop-samples)))
          (buf (snd-fetch-array sig frame-size max-frame-size)
               (snd-fetch-array sig frame-size max-frame-size)))
        ((not buf) out)
      (setf out
        (sim out
             (snd-from-array (/ T0 *sound-srate*) *sound-srate* buf))))))

(if (soundp *track*)
    (drop-samples *track*)
    "Error.\nMono track only")
And here's a short demo - first with no effect, then two examples of the effect.
Attachments
before-after-after.mp3
(176.73 KiB) Downloaded 85 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Trebor
Posts: 9955
Joined: Sat Dec 27, 2008 5:22 pm
Operating System: Windows 8 or 8.1

Re: Simulating a poor VOIP call (dropped frames)

Post by Trebor » Wed Aug 23, 2017 3:46 am

sgx2 wrote:Does this group have any suggestions of filters I can use for this purpose?
If you install FFmpeg libraries into Audacity, you can use AMR (narrowband) codecs, as heard on mobile phones ...
AMR (mobile-phone) codecs available in Audacity if FFmpeg is installed.png
AMR (mobile-phone) codecs available in Audacity if FFmpeg is installed.png (7.73 KiB) Viewed 793 times

sgx2
Posts: 6
Joined: Mon Aug 21, 2017 9:56 pm
Operating System: OS X 10.6 Snow Leopard or earlier

Re: Simulating a poor VOIP call (dropped frames)

Post by sgx2 » Wed Aug 23, 2017 6:22 am

These look like interesting options -- thanks for the input!

Now, to work...

sgx2
Posts: 6
Joined: Mon Aug 21, 2017 9:56 pm
Operating System: OS X 10.6 Snow Leopard or earlier

Re: Simulating a poor VOIP call (dropped frames)

Post by sgx2 » Wed Aug 23, 2017 6:38 am

steve wrote:Here's a little script that can be run in the Nyquist Prompt effect.
It should only be used with fairly short mono tracks.
Wow - this nailed it completely. By using a small frame size and a large max dropped samples value, then silencing the dropped samples, it sounds much like a poor quality VOIP call with dropped frames.

Thanks, Steve. This was very helpful :)

Post Reply