topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday December 7, 2021, 3:08 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Program to play inaudible sound continuously  (Read 2576 times)

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,430
    • View Profile
    • Donate to Member
Program to play inaudible sound continuously
« on: April 09, 2021, 06:39 PM »
Old solutions for new problems....

I had an old Pentium I computer with a combo modem/soundcard that had issues staying connected to the internet when a system sound played (system would lock up just long enough to kick me offline), unless there was sound continuously flowing through the soundcard at all times. This meant playing music all the time, and usually keeping the speakers turned off if I didn't want to hear it, till I came across a small app capable of playing continuous low frequency tones that my cheap speakers were unable to produce. (25 Hz did the trick)

Flash forward to a couple of days ago, when a screwy Windows feature update, which I am unable to uninstall, messed up my bluetooth, so that no matter how I have the hardware settings configured, it turns Bluetooth off (to save power) when it thinks it is not in use. This is very BAD for a bluetooth mouse. I reported here about this issue in this thread, and was avoiding reinstalling that update for as long as possible, but Microsoft managed to automatically cram it down my throat when I recently rebooted my machine, despite having updates paused till some time in January.

BUT I noticed it doesn't cut off my mouse if I have sound playing through my bluetooth headphones. So, I am back to using that very old app, to generate a continuous 10 Hz tone, just so I can use my mouse.

I had to use the system volume mixer to set the volume of this app at a very low level, since my bluetooth headphones are capable of producing audible sound generated from this app, at even the lowest (10 Hz) setting.

Do you have a link to that app, app?

About 6 months ago I moved my entire PC setup into another room, and when I plugged in my speakers to the power source (a surge protector), they made a very loud POP sound, and ever since then none of the audio jacks on my PC work. So now I've got a bluetooth speaker connected to my PC, but it has the unfortunate problem of taking half a second to "warm up" (or catch up?) whenever some audio is played for the first time after a few seconds of silence. And it's like it receives and plays that first half-second of audio all at once, making an unpleasant (and relatively loud) popping or crackling sound in the speaker as it begins to play audio.

I figure if I could trick it into thinking it is constantly playing audio, then it would stay "awake" and not have this issue. Then I remembered you mentioned playing an inaudible, low frequency sound to help with your BT issues and so here I am, asking about it. :D

« Last Edit: April 09, 2021, 06:57 PM by Deozaan »

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,849
    • View Profile
    • Donate to Member
Re: Program to play inaudible sound continuously
« Reply #1 on: April 09, 2021, 09:24 PM »
Then I remembered you mentioned playing an inaudible, low frequency sound to help with your BT issues and so here I am, asking about it. :D

If, for example, you don't use Windows Media Player for anything, you could set it to play the same (tiny) audio file in a loop. Getting a 25Hz WAV file will be the hardest part to do in this workaround.

But if you do use Windows Media Player (?!?!!), you could substitute it for a simple portable audio-player with a tiny GUI that you can easily hide from view or one with no GUI at all. If this player doesn't have a 'loop' mode, you could use the Task Scheduler built into Windows to play the sound every 10 seconds for example. 

A tiny batch or powershell script can automate the few steps this workaround takes to play the sound, so it works with a simple double-click. Quick and easy.
« Last Edit: April 09, 2021, 09:37 PM by Shades »

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,849
    • View Profile
    • Donate to Member
Re: Program to play inaudible sound continuously
« Reply #2 on: April 09, 2021, 10:09 PM »
Overview from command-line audio players:
DLCPlayer
MPXplay (this one has a CUI, not a GUI)

You can create a WAV file with a 18Hz tone yourself with Audacity (open source). 18Hz was the frequency where I stopped hearing it. 25Hz was still as clear as day. Which is weird, as I am way closer to 50 than I like to admit and I have not been kind to my ears all those years. Or you could use the 10 seconds of glorious 18Hz WAV file I attached to this post.

Personally I prefer portable applications, so for my situation an example batch file would look like:
Code: PowerShell [Select]
  1. D:\PortableApps\MultiMedia\Audio\MPXplay\mpxp_mmc_x64.exe -pre D:\PortableApps\MultiMedia\Audio\MPXplay\18Hz_44100Hz_16bit_10sec.wav

Save this script as: Play_18Hz_continuously.bat     or    Play_18Hz_continuously.cmd    or    Play_18Hz_continuously.ps1

This would play the 18Hz file in a loop. Whenever you turn on your computer, you start this little script too and you'll have what you need.

And if you want to make sure it starts when your computer boots, you could also use the Windows Task Scheduler to configure a task that executes this script when your system boots. Then you don't even have to remember to activate it at all. 

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 628
    • View Profile
    • Donate to Member
Re: Program to play inaudible sound continuously
« Reply #3 on: April 09, 2021, 10:53 PM »
Hi there,
i did not read this full thread, just last post.

I did attached an executable CLI program that might help for that matter.
How it work? Total easy ofc.
Extract file somewhere and call the kzToneGenerator.exe program to test it.
You'll be asked for Hz, Duration and Volume.
When sound output is done, application does self terminate.

Definitions:
Hz = Hertz
Duration = count in milliseconds / 1000 = 1 second
Volume = range from 0 to 1 / 0 = 0% volume, 1 = 100% volume

If tests are good, you can call it with 3 parameters, you guessed right, again Hz, Duration and Volume are needed.
Example: "kzToneGenerator.exe 100 1000 0.5"  <<- would play a 100Hz sound for 1000ms(1sec) at half possible volume output.

Like it, tell me?!

Just a quicky made for you ;)


(you can rename .exe name to whatever you want, program is portable, program is freeware)

Technical details:
Compiler: Delphi  :-*
Channels: 1 (mono)
SamplesPerSec: 44100
BitsPerSample: 32
All done via WinApi  :-* :-* :-*

VirusTotal results:
Screenshot - 10_04.pngProgram to play inaudible sound continuously
I am sorry for two false-positives.
« Last Edit: April 09, 2021, 11:31 PM by KodeZwerg »

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,430
    • View Profile
    • Donate to Member
Re: Program to play inaudible sound continuously
« Reply #4 on: April 10, 2021, 01:21 AM »
Thank you very much for your response, Shades. Your suggestions look like adequate workarounds for my issue. :Thmbsup:

Example: "kzToneGenerator.exe 100 1000 0.5"  <<- would play a 100Hz sound for 1000ms(1sec) at half possible volume output.

Like it, tell me?! Just a quicky made for you ;)

It works wonderfully. May I request a change to pass in -1 duration for it to play forever? Or possibly have it play forever until I press some input (such as Q) to stop it? If you don't want to bother with adding input checking, then I'm fine with being able to have it play forever and I can press ctrl-c to interrupt it.

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 628
    • View Profile
    • Donate to Member
Re: Program to play inaudible sound continuously
« Reply #5 on: April 10, 2021, 02:13 AM »
It works wonderfully. May I request a change to pass in -1 duration for it to play forever? Or possibly have it play forever until I press some input (such as Q) to stop it? If you don't want to bother with adding input checking, then I'm fine with being able to have it play forever and I can press ctrl-c to interrupt it.

Sure my friend, here you go   :D

I picked your last option because i am lazy (CTRL-C)

Whats changed: EVERYTHING....not, just input parts are modified to new wish, i was not aware of loop.
Program needs now some seconds to generate 1 hour of audio data.

How-To: "kzToneGenerator.exe 100 0,5" <<-- play 100Hz at 50% volume ... endless/until CRTL-C/until CLI closed/until reboot. Whatever happens first.

VirusTotal: untested
Details: unchanged

What i can not fix and being aware of: every hour, if sound is "hearable" it will interrupt for some milliseconds (WinApi does not know "endless")

Me hopes to fulfilled your wish.

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,430
    • View Profile
    • Donate to Member
Re: Program to play inaudible sound continuously
« Reply #6 on: April 10, 2021, 03:00 AM »
Me hopes to fulfilled your wish.

Thank you kindly. I'll start using it and give you more feedback if needed. If you don't hear back from me on this, then that means it's working well. :Thmbsup:

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 628
    • View Profile
    • Donate to Member
Re: Program to play inaudible sound continuously
« Reply #7 on: April 10, 2021, 03:47 AM »
one more change was made since now i've read for what you need it.

no input/options at all.
no lag at startup.

it open a cli and do its job i hope.

test if it does what your post #1 wanted, 100% inaudible.
I'll start using it and give you more feedback if needed.
a "thanks it work" would be nice to read.

details: secret.

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,430
    • View Profile
    • Donate to Member
Re: Program to play inaudible sound continuously
« Reply #8 on: April 11, 2021, 01:29 PM »
v0.3 doesn't seem to work for me. It says it's playing my favorite kind of music ( :P ) but the speaker never makes the initial crackle sound that would indicate audio is playing, and the volume mixer doesn't show any indication that any audio is being played. And when other audio does play, it begins with the crackling that this app is meant to help avoid.

v0.2 does work for me configured at 10 Hz at 0.1 volume, but has some issues which I'm not sure you can fix. When I put my computer to sleep and wake it up again in the morning, it doesn't seem to be playing audio anymore. I think this may have something to do with the fact that my PC has to reconnect to the BT speaker, which changes the output audio temporarily. My guess is that your app doesn't handle changes to the audio device and doesn't recover from that. But once I stop it and start it up again, it works like a charm until the next time I put my PC to sleep.

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 628
    • View Profile
    • Donate to Member
Re: Program to play inaudible sound continuously
« Reply #9 on: April 11, 2021, 03:50 PM »
v0.3 doesn't seem to work for me. It says it's playing my favorite kind of music ( :P ) but the speaker never makes the initial crackle sound that would indicate audio is playing, and the volume mixer doesn't show any indication that any audio is being played. And when other audio does play, it begins with the crackling that this app is meant to help avoid.

v0.2 does work for me configured at 10 Hz at 0.1 volume, but has some issues which I'm not sure you can fix. When I put my computer to sleep and wake it up again in the morning, it doesn't seem to be playing audio anymore. I think this may have something to do with the fact that my PC has to reconnect to the BT speaker, which changes the output audio temporarily. My guess is that your app doesn't handle changes to the audio device and doesn't recover from that. But once I stop it and start it up again, it works like a charm until the next time I put my PC to sleep.
v0.3 was extra made to have no crackle, that was my secret ingredient lol
i guess playing with negative values was not my best idea, sorry for that.

Strange that is with sleep > wake up > somehow broken.

I have now implemented an audio device check every minute.
I can not test it well since I do not have your Hardware.
I added a new commandline parameter.
Please try this:
run >> "kzToneGen.exe verbose"
at least have Pc 3-4 minutes awake with BT to have some "found audio device" text written.
put Pc to sleep / turn BT off. (whatever your normal order is)
wait again at least 3-4 minutes.
wake Pc up / login / check what my app wrote (and still is writing) and check if BT works fine.

if that does not work i run out of ideas for the CLI version for the moment.

waveOutOpen << this is the api i am using to connect audio device and recheck every minute.

if it work, just use it without "verbose" to not spam memory with endless text.

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,868
    • View Profile
    • Donate to Member
Re: Program to play inaudible sound continuously
« Reply #10 on: April 11, 2021, 08:24 PM »
Do you have a link to that app, app?

You should first start here, to see if these instructions can solve your problem. If not, then keep reading.

My issue turned out to be a driver issue. Intel no longer supports the Bluetooth that's in my laptop, and won't issue updated drivers for it. The current drivers don't seem to work well with the latest Win10, and the power management settings seem to get ignored.

Before you go looking for another solution, though, try seeing if there is a driver update available for your existing Bluetooth hardware, first. If you are lucky, there will be one, and it will make your life much easier.

The app I was using was a very old freeware app that I found quite a few years ago on one of the Rutgers University subsites, but is no longer available there. I have attached it to this post.

For me, it was OK as a temporary work around, but not as a good long term solution, since I could actually hear the sound it generated, unless I went into Windows sound settings and turned the volume almost to mute, for just this app. It still created a bit of distortion, but not so bad that I couldn't live with it, temporarily.

As a long term solution to my Bluetooth issues, that works perfectly, I ended up buying this Bluetooth 5 dongle. (There's currently a coupon available, worth 30% off. Be sure to check the page for it)

« Last Edit: April 11, 2021, 08:37 PM by app103 »

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,430
    • View Profile
    • Donate to Member
Re: Program to play inaudible sound continuously
« Reply #11 on: April 12, 2021, 10:58 AM »
@KodeZwerg: I have good news and bad news. v0.4 appears to successfully recover from sleep now! But it is a bit worse in terms of the moment-to-moment usage. If there's no other audio playing, v0.4 makes the speakers crackle every few minutes when it detects the audio device.

@app103: Thanks for that. The info you linked was a dead end for me, and my BT dongle is a cheap generic Chinese product from DealExtreme or AliExpress or similar. It didn't come with drivers or any indication of the manufacturer or chipset so I'm reliant on Windows to determine what drivers it needs and whether or not there are updates available, and it says there are no updates. But the Wave Generator seems to work well. 10 Hz isn't audible (to me) from this speaker, so I don't mind this as a solution until I decide to spend the few dollars on a USB->audio jack dongle. I haven't tested whether or not it survives/recovers from my PC entering sleep mode since I stopped it so I could test out KodeZwerg's app, but I suspect I'll find that out sometime in the coming days. :Thmbsup:

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 628
    • View Profile
    • Donate to Member
Re: Program to play inaudible sound continuously
« Reply #12 on: April 12, 2021, 01:15 PM »
@KodeZwerg: I have good news and bad news. v0.4 appears to successfully recover from sleep now! But it is a bit worse in terms of the moment-to-moment usage. If there's no other audio playing, v0.4 makes the speakers crackle every few minutes when it detects the audio device.

At least I do understand now what happen, thanks for that important information!  :Thmbsup:

The problem is in general how it works.  :'(

I have added again a micro change.
Running with verbose switch = every minute it detect audio.  (for debug purposes to see whats happen)
Running without verbose switch = every hour it detect audio. (for normal usage)
(it will recover, might need one hour to do so in worst case)

This will be the last CLI version since under CLI I do not have that much control.

Planned:
For my newly spawned "KodeZwerg's Realm" I will create GUI version of Tone Generator.
It might have same bug for you but also a "Re-Detetect" button to quick make it run again. (why "might" and not "will", because I am unsure of how I implement everything)
And other features that you do not need at all  8)

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,430
    • View Profile
    • Donate to Member
Re: Program to play inaudible sound continuously
« Reply #13 on: April 13, 2021, 12:48 AM »
I have added again a micro change.
Running with verbose switch = every minute it detect audio.  (for debug purposes to see whats happen)
Running without verbose switch = every hour it detect audio. (for normal usage)
(it will recover, might need one hour to do so in worst case)

So... here's an idea. Let me know if this will work or if there's a reason this can't be done (or if you just don't want to do it, that's fine, too):

Can you check the system datetime every minute, and only detect audio if the datetime is significantly different from the last time it was checked? My thinking is that if the app checks the time before I put my PC to sleep, then when I wake it up again the next time the app checks the time it will see that several hours have passed.

So, I think something as simple as only detect audio if the clock has changed by 5+ minutes should be sufficient.

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 628
    • View Profile
    • Donate to Member
Re: Program to play inaudible sound continuously
« Reply #14 on: April 13, 2021, 04:52 AM »
Let me know if this will work or if there's a reason this can't be done (or if you just don't want to do it, that's fine, too):

Can you check the system datetime every minute, and only detect audio if the datetime is significantly different from the last time it was checked? My thinking is that if the app checks the time before I put my PC to sleep, then when I wake it up again the next time the app checks the time it will see that several hours have passed.

So, I think something as simple as only detect audio if the clock has changed by 5+ minutes should be sufficient.

To disappoint you in advance, your suggestion is not possible within CLI version.
BUT I did modified again a tiny bit of code and really really really (did i say really already?) really hope that it will fix all above issues without need to close and run app again.

What I have done now is the following:
run application without any switch = it will do the one hour loop task.
each hour it reset itself.
(yes, that we know already...)
if it does not find audio, instead of waiting in worst case another hour, i decreased the waiting time to 30seconds (DO NOT RUN THIS VERSION WITH "VERBOSE", it would spamm console memory aloooooooooot, use verbose only for testing)

What I can not say is for example how my app react within the one hour thread.
Like, start app, put pc to sleep / disconnect Audio device, wake up Pc and attach Audio (all within one hour)
If it break the chain to the thread (and recheck after 30sec again and again) or if it will dumb do its one hour task to then recognize "hey, no more device, lets wait 30sec to retry"...

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,430
    • View Profile
    • Donate to Member
Re: Program to play inaudible sound continuously
« Reply #15 on: April 15, 2021, 03:00 AM »
What I can not say is for example how my app react within the one hour thread.
Like, start app, put pc to sleep / disconnect Audio device, wake up Pc and attach Audio (all within one hour)
If it break the chain to the thread (and recheck after 30sec again and again) or if it will dumb do its one hour task to then recognize "hey, no more device, lets wait 30sec to retry"...

Just reporting that after having my PC sleep overnight it took approximately 1 hour before kzToneGen recovered and started playing sound again.
« Last Edit: April 15, 2021, 12:56 PM by Deozaan »

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 628
    • View Profile
    • Donate to Member
Re: Program to play inaudible sound continuously
« Reply #16 on: April 15, 2021, 06:35 AM »
Dayum... i really hoped it would break the chain.
(I try something later, report back when done, my fear is, that the try will end with crackles again...)