Click here to Skip to main content
15,883,852 members

Comments by T1xT (Top 36 by date)

T1xT 23-Aug-22 17:41pm View    
well; I took the sample rate as the volume control like this:


double kk=MAX_AMPLITUDE; double k;

for (int tIx= 0; tIx < shortBufferSize; tIx++)
{
if(tIx
T1xT 13-Jul-22 14:35pm View    
ok, tank you.
T1xT 13-Jul-22 14:12pm View    
yes, but is sample size just meant to be used for amplitude? that's the question I don't find an answer over the net for -and yes this is the exact code and it plays the 2 hz - most likely it's about the playback hardware since in the app I use to generate frequency on the phone, it acts differently with the phone's speaker and earphone, so output sound probably depends on the hardware too.
btw, does it need many changes if I want to make it stereo?
T1xT 12-Jul-22 19:26pm View    
well, thank you for the answer. just got your code to test; everything in your code is correct and works fine (only the part about the sample size isn't clear enough to me).
I run your code and to be honest, it still plays a 2hz which you can actually hear - so just don't know where is the problem; if is with the sound setting of windows or something else. but there is something about this code, that it is better than the first code I've copied here because it clearly plays a 1hz that everyone can hear it.
anyway I am going to accept the answer since the community here agree with it, so it should be correct - thanks for the time you spent for the solution.
T1xT 2-Jul-22 9:26am View    
really thanks for the answers; I will be back on them soon and I am still working on the waves and energy theories that is needed for my project.