<div dir="ltr"><div>Eliot did some rework on the sound plugin a few months back. How new is your VM ?</div><div><br></div><div>Best,</div><div>Karl</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 9, 2020 at 6:19 PM Thiede, Christoph <<a href="mailto:Christoph.Thiede@student.hpi.uni-potsdam.de">Christoph.Thiede@student.hpi.uni-potsdam.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div id="gmail-m_1611660423003801932divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>Hi all,</p>
<p><br>
</p>
<p>for a test, I am storing sounds into a ByteArray and read them again. This works well for PluckedSounds, for example, but I found some strange behavior when doing the same with SampledSounds:</p>
<p><br>
</p>
<blockquote style="margin:0px 0px 0px 40px;border:medium none;padding:0px">
<p></p>
<div>sound := SampledSound new</div>
<p></p>
<p></p>
<div><span style="white-space:pre-wrap"></span>setSamples: SampledSound coffeeCupClink</div>
<p></p>
<p></p>
<div><span style="white-space:pre-wrap"></span>samplingRate: 12000.</div>
<p></p>
<p></p>
<div><br>
</div>
<p></p>
<p></p>
<div>bytes := ByteArray streamContents: [:stream |</div>
<p></p>
<p></p>
<div><span style="white-space:pre-wrap"></span>sound storeWAVSamplesOn: stream].</div>
<p></p>
<p></p>
<div><br>
</div>
<p></p>
<p></p>
<div>outputSound := SampledSound fromWaveStream: bytes readStream binary.</div>
<p></p>
</blockquote>
<p><br>
</p>
<p>After running this script, I would expect <span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px">
outputSound</span> to have the same samples as sound. But actually, every byte in the SoundBuffer appears twice! Still, playing the sound does not sound differently in my ears. I traced the issue down and found out that #<span>mixSampleCount:into:startingAt:leftVol:rightVol:
 is writing every byte four times on the stream - two would be okay for left and right channel, but I do not understand the four. I reproduced the issue both on Windows and Ubuntu (WSL). Disabling the primitive did not help either.</span></p>
<p><span><br>
</span></p>
<p><span>So I am wondering: Is this a bug or totally fine (because you cannot hear a difference anyway)? If the latter is the case, how can I compare the sounds else in a reliable way? If I </span><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">store
 outputSound again, the number of bytes is doubled again, so if you do certain operations, your image will blow up exponentially ...</span></p>
<div id="gmail-m_1611660423003801932Signature">
<div id="gmail-m_1611660423003801932divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="divtagdefaultwrapper">
<div>
<div id="gmail-m_1611660423003801932Item.MessagePartBody">
<div id="gmail-m_1611660423003801932Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="gmail-m_1611660423003801932divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="gmail-m_1611660423003801932Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont">
<div><font size="3" color="black"><span style="font-size:12pt"><a href="http://www.hpi.de/" rel="noopener noreferrer" id="gmail-m_1611660423003801932LPNoLP" target="_blank"><font size="2"><span id="gmail-m_1611660423003801932LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</font></div>
</div>
</font></div>
</div>
</div>
</div>
<div id="gmail-m_1611660423003801932Item.MessagePartBody"><br>
</div>
<div id="gmail-m_1611660423003801932Item.MessagePartBody">For the context of this question, see also: <a href="http://forum.world.st/Overriding-in-Graphics-and-Sounds-td5122783.html" id="gmail-m_1611660423003801932LPlnk760119" target="_blank">http://forum.world.st/Overriding-in-Graphics-and-Sounds-td5122783.html</a></div>
<div id="gmail-m_1611660423003801932Item.MessagePartBody"><br>
</div>
<div id="gmail-m_1611660423003801932Item.MessagePartBody">Best,</div>
<div id="gmail-m_1611660423003801932Item.MessagePartBody">Christoph</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
</div>

<br>
</blockquote></div>