(x, y, sample_size=2)
| 28 | |
| 29 | |
| 30 | def _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 | |
| 47 | def voip_play(s1, lst=None, **kargs): |