synth seems to generate "pops"?
Brian Watson <[email protected]> Tue, 25 Mar 2025 11:58:15 -0300
| Newsgroups | gmane.comp.audio.sox |
|---|---|
| Message-ID | <CAN255p4-R5e=_0R9g43z6jTzaVercAcsBoxBBYvfekjSCb9zUQ@mail.gmail.com> |
--===============3971112622121969069== Content-Type: multipart/alternative; boundary="000000000000e53a8b06312bf36b" --000000000000e53a8b06312bf36b Content-Type: text/plain; charset="UTF-8" Hi, I'm thinking of using sox's synth capability to make myself a simple hearing tester. It will play a bunch of tones at various frequencies, channels and volumes and record my response, or not. After a bit of reading I have figured that something like this: play -r 44100 -n -t alsa synth 0.5 sin 5000 vol -25dB remix 1 0 wrapped into a script with the frequency, gain and remix parameters replaced with variables will work exactly as I had hoped. Except - when I listen to the generated sounds there is a small pop, or crack, at the start and end of each sound. This is going to invalidate my results as the pop/crack is, obviously, not at the frequency of the test tone. The obvious answer is that this pop/crack comes from ALSA, or my DAC or my headphones. The only thing that makes me think that it is sox is that the "vol" given to "synth" changes the volume of the pop/crack. If I do, for example: play -r 44100 -n -t alsa synth 0.5 sin 5000 vol -100dB remix 1 1 I get nothing but silence. I'm taking this as sox being able to open my sound hardware and play the very quiet sound with no pop/crack? I've seen discussion on similar topics where duration of the tone is manipulated to ensure it aligns with write buffers. I suspect that's the problem I am seeing, but I don't understand enough to take that information and apply it here. Also, I'm doing this as a learning exercise/experiment and am not trying to create a "product", but if this has already been done or there are better ways to do it I'd be interested to learn. --000000000000e53a8b06312bf36b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Hi,</div><div><br></div><div>I'm thinking of usin= g sox's synth capability to make myself a simple hearing tester.=C2=A0 = It will play a bunch of tones at various frequencies, channels and volumes = and record my response, or not.</div><div><br></div><div>After a bit of rea= ding I have figured that something like this:</div><div><br></div><div>play= -r 44100 -n -t alsa synth 0.5 sin 5000 vol -25dB remix 1 0</div><div><br><= /div><div>wrapped into a script with the frequency, gain and remix paramete= rs replaced with variables will work exactly as I had hoped.</div><div><br>= </div><div>Except - when I listen to the generated sounds there is a small = pop, or crack, at the start and end of each sound.=C2=A0 This is going to i= nvalidate my results as the pop/crack is, obviously, not at the frequency o= f the test tone.</div><div><br></div><div>The obvious answer is that this p= op/crack comes from ALSA, or my DAC or my headphones.=C2=A0 The only thing = that makes me think that it is sox is that the "vol" given to &qu= ot;synth" changes the volume of the pop/crack.=C2=A0 If I do, for exam= ple:</div><div><br></div><div> <div>play -r 44100 -n -t alsa synth 0.5 sin 5000 vol -100dB remix 1 1</div>= <div><br></div><div>I get nothing but silence.=C2=A0 I'm taking this as= sox being able to open my sound hardware and play the very quiet sound wit= h no pop/crack?</div><div><br></div><div>I've seen discussion on simila= r topics where duration of the tone is manipulated to ensure it aligns with= write buffers.=C2=A0 I suspect that's the problem I am seeing, but I d= on't understand enough to take that information and apply it here.</div= ><div><br></div><div>Also, I'm doing this as a learning exercise/experi= ment and am not trying to create a "product", but if this has alr= eady been done or there are better ways to do it I'd be interested to l= earn.</div> <br></div><div><br></div></div> --000000000000e53a8b06312bf36b-- --===============3971112622121969069== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============3971112622121969069== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Sox-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sox-users --===============3971112622121969069==--