MCPcopy Index your code
hub / github.com/secdev/scapy / _merge_sound_bytes

Function _merge_sound_bytes

scapy/modules/voip.py:30–44  ·  view source on GitHub ↗
(x, y, sample_size=2)

Source from the content-addressed store, hash-verified

28
29
30def _merge_sound_bytes(x, y, sample_size=2):
31 # TODO: find a better way to merge sound bytes
32 # This will only add them one next to each other:
33 # \xff + \xff ==> \xff\xff
34 m = ""
35 ss = sample_size
36 min_ = 0
37 if len(x) >= len(y):
38 min_ = y
39 elif len(x) < len(y):
40 min_ = x
41 r_ = len(min_)
42 for i in range(r_ / ss):
43 m += x[ss * i:ss * (i + 1)] + y[ss * i:ss * (i + 1)]
44 return x[r_:], y[r_:], m
45
46
47def voip_play(s1, lst=None, **kargs):

Callers 1

playFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected