<li><strong>Bytes object contains a seqence of frames, each consisting of one or more samples.</strong></li>
<li><strong>Each sample consists of one or more bytes that, when converted to an integer, indicate the displacement of a speaker membrane at a given moment.</strong></li>
<li><strong>If sample width is one, then the integer is interpreted as unsigned.</strong></li>
<li><strong>For all other sample sizes the integer is interpreted as signed with little-endian byte order.</strong></li>
<li><strong>Bytes object contains a sequence of frames, each consisting of one or more samples.</strong></li>
<li><strong>In stereo signal first sample of a frame belongs to the left channel.</strong></li>
<li><strong>Each sample consists of one or more bytes that, when converted to an integer, indicate the displacement of a speaker membrane at a given moment.</strong></li>
<li><strong>If sample width is one, then the integer should be encoded as unsigned.</strong></li>
<li><strong>For all other sizes the integer should be encoded as signed with little-endian byte order.</strong></li>
<div><h4id="addsnoisetoamonowavfile">Adds noise to a mono WAV file:</h4><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">from</span> random <spanclass="hljs-keyword">import</span> random
frames_f = (a + (random()<spanclass="hljs-number">-0.5</span>) * <spanclass="hljs-number">0.03</span><spanclass="hljs-keyword">for</span> a <spanclass="hljs-keyword">in</span> read_wav_file(<spanclass="hljs-string">'test.wav'</span>))
add_noise = <spanclass="hljs-keyword">lambda</span> value: value + (random()<spanclass="hljs-number">-0.5</span>) * <spanclass="hljs-number">0.03</span>
frames_f = (add_noise(a) <spanclass="hljs-keyword">for</span> a <spanclass="hljs-keyword">in</span> read_wav_file(<spanclass="hljs-string">'test.wav'</span>))
xxxxxxxxxx