topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Thursday November 7, 2024, 3:55 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

Last post Author Topic: IDEA: play random wav from a folder at random times  (Read 36613 times)

jimduggan

  • Participant
  • Joined in 2019
  • *
  • default avatar
  • Posts: 12
    • View Profile
    • Donate to Member
IDEA: play random wav from a folder at random times
« on: July 09, 2019, 05:33 PM »
Hello

This is an app I would find useful.

sounds.pngIDEA: play random wav from a folder at random times

What it does:
=============

If it is on, it looks at all the .wav files in the folder it is running from.

It then plays one of the .wav files at random.


Settings:
=========

If it is off, all settings are greyed out.

If on, and if it is set to the timed option, it plays the random .wav file at a set time interval.

If on, and if it is set to the random option, it plays the random .wav file at a random time within each chosen time bracket.

Other:
======

PlayWAV can be used t play the .wav file in the background:

https://www.horstmuc...e/wminis.htm#playwav

Ideally, before it plays the .wav, it should detect if the sound system is currently in use by another program, and if so, skip playing this time.

It should minimise to the system tray.

Please let me know your thought and comments.

Thank you!

p3lb0x

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 424
  • Beer, beer, beer, I'm going for a beer!
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #1 on: July 11, 2019, 12:33 AM »
If no one else takes this, I'll take a shot at it in about a week.
Stop mousering people so much - Mouser

jimduggan

  • Participant
  • Joined in 2019
  • *
  • default avatar
  • Posts: 12
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #2 on: July 21, 2019, 02:57 PM »
Thank you so much.
Did you manage to make any progress?
I found this which may help:
https://superuser.co...ime-beep-on-the-hour

jimduggan

  • Participant
  • Joined in 2019
  • *
  • default avatar
  • Posts: 12
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #3 on: August 06, 2019, 05:40 AM »
Or is anyone else perhaps interested in this project?

p3lb0x

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 424
  • Beer, beer, beer, I'm going for a beer!
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #4 on: September 03, 2019, 06:25 AM »
My bad completely forgot about it due to real life. I'll give it a shoot soon.
Stop mousering people so much - Mouser

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #5 on: September 11, 2019, 12:45 PM »
Or is anyone else perhaps interested in this project?

I'm taking it! :Thmbsup:

RandomSoundsApp_DonationCoder.png

Source code @ https://github.com/p...main/randomsoundsapp

Release to be announced in a reply here as soon as it's complete.

Cheers!
Vic
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com

jimduggan

  • Participant
  • Joined in 2019
  • *
  • default avatar
  • Posts: 12
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #6 on: September 14, 2019, 11:15 AM »
 :up: Wow! Thank you so much Vic! I can't wait to try this out!

Do you think it could use a [Cancel][Apply][OK] button set at the bottom?
After I drew the mockup, I realised I had not included one.

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #7 on: September 15, 2019, 07:32 PM »
:up: Wow! Thank you so much Vic! I can't wait to try this out!

My pleasure Jim  :)

The program is finished. I'm making initial release in next reply.

Do you think it could use a [Cancel][Apply][OK] button set at the bottom?
After I drew the mockup, I realised I had not included one.

Given the way it's coded you may not need the extra buttons: it auto-enables timers on settings' selection and clears all sound players when clicking off :Thmbsup:

Let's give a shot @ this version (no problem if you need to add something else after your review)

Cheers!
Vic
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: September 16, 2019, 02:43 AM by publicdomain »

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #8 on: September 16, 2019, 06:30 PM »
Random Sounds App v0.1.0

RandomSoundsApp_0-1-0.png

Release info + download.

Enjoy! :Thmbsup:
Vic
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: September 17, 2019, 03:44 AM by publicdomain »

jimduggan

  • Participant
  • Joined in 2019
  • *
  • default avatar
  • Posts: 12
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #9 on: September 23, 2019, 11:09 PM »
Hello Vic!

I've been testing this and am super impressed. You did a fantastic job, and I want to sincerely thank you!

I have some suggestions for any future revisions:

1) There is no need for a 'sizer' in the corner, because the form doesn't resize it's contents, and I don't think it even should.

2019-09-24 06_05_23-Random Sounds App.pngIDEA: play random wav from a folder at random times

2) When you start the app, it is in the OFF state, with the OFF radio button selected. If you then click the ON radio button, one of the settings radio buttons below it should be automatically selected too. At the moment, when you click the ON radio button, none of the settings below are selected by default, so it's not actually ON. For example:

2019-09-24 06_06_31-.pngIDEA: play random wav from a folder at random times

3) Definitely my fault for not being clear in my language. I think one of the uses of this program is to play a small beep every hour (or every 15 minutes, or half an hour etc.) like those old Casio watches, so you can be conscious of the passing of time. Currently, if you select the first option to "play sound exactly every 15 minutes" for example, it does so every 15 minutes *from the time the app was turned on*.

Ideally, it should play it every 15 minutes *from the hour*! So for example, if I start the app at 3.07pm, it should play at 3.15pm, then at 3.30pm, then at 3.45pm etc.

So I think you can leave the current option as it is, but it would be better to change the language to explain that the sound will be played *from now*. And if possible, add another option that will play the sound from the hour. Here's a mockup of what it could look like:

2.pngIDEA: play random wav from a folder at random times

Please let me know if that doesn't make much sense!

Once again, I thank you for your work on this. It's really excellent, and I'm using it now! Thank you!

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #10 on: September 24, 2019, 08:29 PM »
My pleasure Jim! :)

Please let me know if that doesn't make much sense!

Your suggestions make perfect sense! Let's engage with doing them as soon as scriptkid's code is set.

...Chances are both programs are complete this very week to end the month successfully! :Thmbsup:

Cheers!
Vic
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #11 on: September 26, 2019, 10:49 AM »
At the moment, when you click the ON radio button, none of the settings below are selected by default, so it's not actually ON.

Roger that Jim. Fixing it!

Chances are next release comes this weekend [Extended by Jim]. Stay tuned :up:
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: October 04, 2019, 02:54 AM by publicdomain »

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #12 on: October 04, 2019, 02:58 AM »
Random Sounds App v0.2.0

RandomSoundsApp_v0-2-0.png

> Release + download_16.png Download link

v0.2.0 changes:
  • Add "minutes from the hour" mode.
  • Fix form size.
  • Update about message.
  • Add remaining time to next play.
  • Add remember last selected radio button.
  • Add guard against empty sounds list.
  • Add silencing player when turning off or changing mode.

Usage video:


Enjoy!  :Thmbsup:
Vic
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: October 04, 2019, 05:23 AM by publicdomain »

jimduggan

  • Participant
  • Joined in 2019
  • *
  • default avatar
  • Posts: 12
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #13 on: October 04, 2019, 03:14 PM »
Hello Vic!
I am so happy with this. Thank you!
I joined your Patreon also (Jim Abdullah Duggan), to show my appreciation for your work.

I really like the little touches you added, specifically the display showing the time remaining to the next play. And I noticed that you added keyboard shortcuts for the options!

I noticed one bug, which I've described below. I'm also using this as a space to record a wishlist for possible future features. Those features are not necessary, because the program will work fine without them. But I just want to have all my thoughts recorded in one place anyway.

Bugs:
====
1) There seems to be a bug introduced in this latest version. I have it set to play a sound every 5 minutes. Every 5 minutes, it sometimes plays a sound for only one second, then cuts that off, and starts another sound instead. It doesn't happen every single time, but it happens quite often. The previous version didn't have this problem as far as I could tell.


Future Wishlist:
==========
1) The maximize button is redundant. Do you think it should be hidden? That way, we only have the minimise and close button on the window titlebar.

2) I start the program, switch it to ON, set my preferred time interval (let's say 5 minutes), and set it to start when Windows starts. Now, when I reboot windows, the program does start automatically, but it is set as OFF, and my preferred time interval is forgotten (it is set back as 15 minutes). So I need to go into the settings to set everything up the way I like after every reboot.

It would be nice if these settings were saved somewhere. Preferably in a .ini file in the same directory (so that the app is kept portable). In that file, you could record:

-- on_state: 1 or 0.
This is 0 in a fresh install, but if the user turns the app ON, the on_state becomes 1. When the user exits the app, the on_state stays at 1. That means that when the user starts the app again, it already starts on the ON state. If the user turns the app to OFF, it does the reverse: the next time the app is started, it starts in the OFF state also (since on_state in the .in file is 0).

The benefit of this scheme is that is means the app is already ON and running when it starts up with Windows, without having to go into the settings again and manually turning it on.

-- option_state: 1, 2, or 3.
This is based on the user's last selected option (1=play after the hour, 2=play from now, 3=play at random).

-- time_interval_option_1: 15
-- time_interval_option_2: 15
-- time_interval_option_3: 15
For example, these will record the time interval that the user last chose for each of the options. By default they are 15 minutes.

How this would all work together: When the app is launched, it looks in the .ini file. The .ini file shows that the user last chose option 1 (play after the hour) and that his selected time interval for option 1 was 5 minutes. Since on_state = 1, the app starts in the ON state. It gets the settings from the .ini file and starts working as last chosen by the user with no further intervention.

3) I'm a teacher and I use my laptop in class. During class, I need to have the program silenced, but during office hours, I want to keep it running. During class, it would be nice if there was a quick way to keep the app running, but just mute it, instead of closing the app completely, and then restarting it again later on. My idea was that there could be a little check box when you right click the tray icon that lets you mute any sounds from the app. Currently, the systray icon says 'Show' and 'Exit'. My idea is that it could be 'Show', 'Mute' and 'Exit'.

4) I'm just putting this out there for my future wishlist. I don't know how feasible it would be, or if it would take too much effort to make it worth while though. I think it would be nice if the app could detect if the windows sound system was already in use, and if so, then skip playing for that time. So for example, if I'm watching a video, then it should not play the random sound over that.

C# code here: https://stackoverflo...rently-playing-sound

Once again I sincerely thank you for your wonderful work in programming this app. I love it!

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #14 on: October 04, 2019, 05:31 PM »
Wowie Jim, I'm very happy of our interactions too! Thank you very much for joining the movement!  :)

Patron by patron we'll make great things as a joint group spread across the forums, from which every interacting user can enjoy the resulting programs & other developers can also re-use the source code.

...I'm 100% willing to devote full-time to assisting the fellows via code.

It is my dream to make a living helping others. It brings tears to my eyes to have it become a reality day by day, thanks to many kind fellows in the software community.

Software itself is truly wonderful! It has a multiplier effect: by serving an user ALL the other users with the same need are served too.

That's priceless!



I'm also using this as a space to record a wishlist for possible future features.

Your suggestions are possible indeed and are going to be programmed into the next releases in the 0.x branch during this October.

Semantic versioning is being used for these public domain releases so the whole 0.x branch is for adding features and bug fixes. There's no rush to make it v1.0; better to make it a solid applications serving its purpose to its fullest.

Also, you're correct: the program now uses a single system timer for all modes, so it's basically using brand new logic which introduced "quirks" to iron-out.

But hey! that's why we're here for.

A most-grateful,
 :-*
Vic
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: October 04, 2019, 07:38 PM by publicdomain »

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #15 on: October 11, 2019, 05:50 AM »
Hello again Jim!

Two points as I implement improvements:

1.  Would you like to have the ability to define/select a different directory from the app? Perhaps adding multiple directories containing sound files?

As there's a settings file now, it's possible to add & save multiple sound sources.

2. Regarding active time:

3) I'm a teacher and I use my laptop in class. During class, I need to have the program silenced, but during office hours, I want to keep it running.

This can be done automatically via scheduled active hours.

I guess you would prefer to have a schedule form in addition to the manual mute option?

Please do provide feedback to make the best program for you :up:

Cheers!
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com

jimduggan

  • Participant
  • Joined in 2019
  • *
  • default avatar
  • Posts: 12
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #16 on: October 11, 2019, 11:35 PM »
Hello Vic!

Thank you kindly for your message!


1) Choosing sounds directory: I don't think I would personally need this feature, but perhaps someone else who comes to use the app might find it beneficial.

2) Setting scheduled active hours: I think this would be a really excellent feature! In fact, I had though about this exact feature before, but felt shy to mention it, since I felt it might increase the scope of the application too much. But since you bring it up, then YES! I think this would be really nice to add!

Thank you so much Vic! I appreciate it so much. I hope some other users find this app useful too. In fact when I was researching if an app like this existed a few months ago, I saw a question on Stackoverflow (I think) where someone was asking how to achieve the exact same thing. So I know that there will be other users out there that could benefit from it.

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #17 on: October 19, 2019, 02:57 PM »
Preferably in a .ini file in the same directory (so that the app is kept portable)

Okay, after trying some ini libraries (such as Enichan/Ini) It's back to simple dotnet-native XML.

Should be rather easy to read & edit too.

Apart from this, the program reflects your petitions to the letter.

Expect it in the next few days, as I'm resuming October's releases
Cheers!
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: November 17, 2019, 05:20 PM by publicdomain »

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #18 on: November 19, 2019, 09:01 PM »
Version 0.3.2 is out!

RandomSoundsApp_0-3-2.png


Please check & provide feedback on the implemented features :Thmbsup:

Cheers!
Vic
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com

jimduggan

  • Participant
  • Joined in 2019
  • *
  • default avatar
  • Posts: 12
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #19 on: November 20, 2019, 07:39 AM »
Hello Vic.

Thank you so much for releasing this latest version!

I tested it and found that:

1) The new mute option works well
2) The new minimise to systray button works well
3) The new settings xml file works, and is easy to understand

I also found that this bug:

There seems to be a bug introduced in this latest version. I have it set to play a sound every 5 minutes. Every 5 minutes, it sometimes plays a sound for only one second, then cuts that off, and starts another sound instead. It doesn't happen every single time, but it happens quite often. The previous version didn't have this problem as far as I could tell.

is still happening.


jimduggan

  • Participant
  • Joined in 2019
  • *
  • default avatar
  • Posts: 12
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #20 on: November 27, 2019, 03:33 PM »
I guess one workaround for this bug is for me to manually add a few seconds of silence at the beginning of every sound clip I have. That way, even if it cuts out and switches to another clip, it will do so while still playing the silent part, so it won't be noticeable.

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #21 on: January 01, 2020, 09:10 PM »
This release should fix multi-play  :Thmbsup:

Download: RandomSoundsApp_v0.4.1_Release.zip

Cheers!
Vic
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com

Damocles

  • Participant
  • Joined in 2020
  • *
  • default avatar
  • Posts: 1
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #22 on: January 05, 2020, 05:05 AM »
Have to ask.....why would you want to do this, apart from a prank?

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,885
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #23 on: January 06, 2020, 05:23 PM »
Have to ask.....why would you want to do this, apart from a prank?

It could have a practical purpose, too. Imagine a folder of positive affirmations, where a random one would play every hour or so, to inspire you. Kind of like an audio version of mouser's Popup Wisdom.

Or in my case....

I made a clock application many years ago, which has an hourly chime that sounds like a cuckoo clock, which has provided much amusement over the years, because when it chimes, it's almost as if my computer is commenting on the current conversation, calling someone "cuckoo". Lots of laughs when it's right, which is often. I don't know why, but someone in my home will usually say or do something crazy at the top of every hour, and my clock is there to call them out on it.  :D

About 20 years ago, I collected a large number of wav files of short single sentence clips from movies, and people saying silly stuff, suitable for playing as comments to chat room conversations on AOL. They have been pretty much useless since leaving AOL, and I kind of miss them. So, I am going to use this little app to play one at random about every 90 minutes or so. Perhaps it will be as fun as my "judgy" little clock butting into our conversations.  ;D

jimduggan

  • Participant
  • Joined in 2019
  • *
  • default avatar
  • Posts: 12
    • View Profile
    • Donate to Member
Re: IDEA: play random wav from a folder at random times
« Reply #24 on: January 08, 2020, 07:32 AM »
It could have a practical purpose, too. Imagine a folder of positive affirmations, where a random one would play every hour or so, to inspire you. Kind of like an audio version of mouser's Popup Wisdom.

That's exactly the way I'm using it! Not a prank at all.
And if you don't want to use it that way, imagine having just one simple 'beep' sound that plays every 15 minutes, or every hour, to remind you of the passing of time and to stop procrastinating. I imagine some people would be happy to use it just in that way, without the random aspect. To do that, you only drop one audio file into the folder, and that's all the app will play.

@publicdomain Thank you for this latest release! I really appreciate your work with this app. It works and I use it every day.

There seems to be a bug when you have the app set to start with the OS. When you reboot the PC and the app starts, it does indeed start, but it doesn't work. I get an popup error message saying Unhandled Exception has occured, and "Access to the path "C:\Windows\system32\SettingsData.txt" is denied. Even though I don't think it should be putting anything in the windows folder. The app itself is in a folder on the desktop.

I will try and reproduce it again and see if I can list the steps required to do so.

For the future, I would only suggest, but only if they are not too much work:
1) trying to mute the audio if the windows sound system is already playing audio (from a video etc.) (code in one of the posts above in this thread).
2) a scheduling option of some sort. (this user interface for scheduling looks interesting: https://softorino.com/volumeconcierge2/)