Bitcoin Forum

Bitcoin => Project Development => Topic started by: sethsethseth on April 19, 2011, 09:05:39 PM



Title: Bounty: Play sound file when block is generated
Post by: sethsethseth on April 19, 2011, 09:05:39 PM
I want a custom sound file to play when I generate a block on windows.  10btc Bounty.


Title: Re: Bounty: Play sound file when block is generated
Post by: Anonymous on April 19, 2011, 10:13:26 PM
I want a custom sound file to play when I generate a block on windows.  10btc Bounty.

awesome. Now what is an appropriate sound for a bitcoin block?

A cash register ?

Depending on your miner you might not hear the sound for a long time.  :)



Title: Re: Bounty: Play sound file when block is generated
Post by: tcatm on April 19, 2011, 10:20:23 PM
Depending on your miner you might not hear the sound for a long time.  :)

Yep, it should temporarily turn off the fans, too... :)


Title: Re: Bounty: Play sound file when block is generated
Post by: PLATO on April 20, 2011, 03:55:49 AM
awesome. Now what is an appropriate sound for a bitcoin block?

http://themushroomkingdom.net/sounds/wav/smb3_coin.wav


Title: Re: Bounty: Play sound file when block is generated
Post by: sethsethseth on April 21, 2011, 06:20:12 PM
YES! coin drop, cash register, firework.... Plz donate guys, i'm sure this will get done with just a little more action


Title: Re: Bounty: Play sound file when block is generated
Post by: gigabytecoin on April 21, 2011, 09:07:05 PM
I want a custom sound file to play when I generate a block on windows.  10btc Bounty.

awesome. Now what is an appropriate sound for a bitcoin block?

A cash register ?

Depending on your miner you might not hear the sound for a long time.  :)



How about one of the casino/lottery winning sound bytes? Those things were specially created to make you feel elated when you hear them, and people already associate it with money.

Some kind of fast, high pitched, major arpeggio would be good.


Title: Re: Bounty: Play sound file when block is generated
Post by: NghtRppr on April 22, 2011, 07:51:56 PM
I could do this pretty easily if I just made it play a sound file when your balance increases.


Title: Re: Bounty: Play sound file when block is generated
Post by: sethsethseth on April 23, 2011, 04:35:15 PM
I really want the sound to happen when the blocks are generated, not a day later when they are confirmed though....


Title: Re: Bounty: Play sound file when block is generated
Post by: LMGTFY on April 23, 2011, 04:56:23 PM
I really want the sound to happen when the blocks are generated, not a day later when they are confirmed though....
On *nix I'd pipe the miner's output to a log file (which I do anyway) and then run a scheduled task every minute or so. The task would need to do some magic (this assumes some like DiabloMiner, which normally shows hash rate until a block is generate, then displays a line containing the word "Block"):

Look at the penultimate line of the log file, and do something like...
If the line contains the string "Block" then...
Code:
grep -E 'Block [0-9]+' -o | awk '{print $2}'
... and then compare the value returned (the block number) with the previous value, if a previous value exists, and if it's different (or there is no previous value) then store the new value and play a sound file.

If I had to do this in Windows I'd end up installing Cygwin or similar, but I'm sure that someone with Windows-fu could do a better job than me.

Disclaimer: rough, untested pseudo-code. The grep bit works, nothing else carries any warranty, guarantee, assurance or promise. Your milage may vary, do not drive or operate heavy machinery, DO NOT TAUNT HAPPY FUN BALL!


Title: Re: Bounty: Play sound file when block is generated
Post by: sethsethseth on April 26, 2011, 11:38:12 PM
geez how much bounty does it take to get simple stuff done around here?  I've paid out a 50btc bounty before, but this seems like a 10min job....


Title: Re: Bounty: Play sound file when block is generated
Post by: Escalion on April 28, 2011, 09:51:42 AM
What system are you using, you was very unclear?

He basically just told you how to do it in linux with pipes....
A simple bash script wouldnt be hard.

For Windows it would require the output to a log, and a seperate worker checking the log every x seconds, at least until a sound is introduced in the client.


Title: Re: Bounty: Play sound file when block is generated
Post by: LMGTFY on April 28, 2011, 01:08:30 PM
What system are you using, you was very unclear?

He basically just told you how to do it in linux with pipes....
A simple bash script wouldnt be hard.

For Windows it would require the output to a log, and a seperate worker checking the log every x seconds, at least until a sound is introduced in the client.
They're definitely using Windows, I don't know which version.

The proposal I made above could be made to work on Windows but you'd need to install Cygwin or similar.


Title: Re: Bounty: Play sound file when block is generated
Post by: shooter_mcgavin on May 11, 2011, 07:55:11 PM
I can write this easily. Tell me what miner you are using and what platform you would like it written for. I can provide both source and binary if you wish.


Title: Re: Bounty: Play sound file when block is generated
Post by: sethsethseth on May 12, 2011, 02:23:51 AM
This is for 64bit windows 7.  Is it possible to have it work with multiple miners?  I am currently deciding if phoenix gives enough boost over GUI miner to switch, and i've switched a bunch of times in the last few months and I want the code to work if I switch miners.


Title: Re: Bounty: Play sound file when block is generated
Post by: shooter_mcgavin on May 12, 2011, 05:04:27 AM
This is for 64bit windows 7.  Is it possible to have it work with multiple miners?  I am currently deciding if phoenix gives enough boost over GUI miner to switch, and i've switched a bunch of times in the last few months and I want the code to work if I switch miners.

Depending on the incentive, I can code in support for multiple miners. It's just extra lines of code.


Title: Re: Bounty: Play sound file when block is generated
Post by: unfinishe on May 12, 2011, 09:34:21 AM
Ok, so I probably didn't need to start a repository for this, but I've never used git or github before, so I figured it'd be fun to try it out.

https://github.com/downloads/unfinishe/Bitcoin-Miner-Ding/ding.zip

I hope that this works. What you do is:

In one cmd window, run your miner from the command-line, except add the following onto the end.

Code:
 > output.txt 2>&1

This sends the output of your miner to a file.

Then in another cmd window, run ding.exe [word], which will scan the file every couple seconds to see whether the output includes the [word] in it. If it does, it will play ding.wav. Just use whatever word signifies in the output that a block has been generated in your miner.

It could definitely be written better, but hopefully it does the job!


Title: Re: Bounty: Play sound file when block is generated
Post by: nereer on May 12, 2011, 10:35:48 AM
awesome. Now what is an appropriate sound for a bitcoin block?

http://themushroomkingdom.net/sounds/wav/smb3_coin.wav

+1

classic. first sound I thought of when I saw this thread :)


Title: Re: Bounty: Play sound file when block is generated
Post by: shooter_mcgavin on May 12, 2011, 03:19:54 PM
sethsethseth, I sent you a PM with the binary file in a zip format. Let me know how it works for you, it should be pretty solid. If anyone else would like to join in on the bounty, please send me a PM. I will consider making it open to the public if it turns out to be a needed feature.



Donations are always nice though :] 

1J2bbukPKFrwEfk4iHueKfLfFBXLSNGnTi


Title: Re: Bounty: Play sound file when block is generated
Post by: Herodes on May 13, 2011, 07:12:22 AM
I have now implemented the request feature, compiled a client binary for win 7 64 bit, and e-mailed it to seth. I talked with him on irc earlier on. Later I might submit this as a patch to the official client if anyone is interested. It wasn't a big job at all, when I first got to coding, but setting up the entire environment for compiling took a long time.

As it is now, it checks for "0/unconfirmed", and once that message pops up in the client, the client will play a sound of your choice. Currently this is just a file named test.wav in your directory. I have just tested it on my win 7 64 bit system, and the only files altered are the ui.cpp and the makefile.

Not sure if more people are interested, then let me know, and I may put out the source. I will at some point anyhow, but I tought I'd refine it a bit more, even if it works now.

There is a glitch tough, the send coin menu item and the adress book item seems to no longer behave perfectly graphically speaking, sometimes when moving the client around the screen, or resizing it, the graphic in the menu line is affected and looks a bit odd, I don't know why this is, but will research it later on.

Complete source is available for the topic starter, and also instructions for how to set up the environment for compiling were sent to him, although I must frankly say that these procedures are a bit daunting for a non-programmer.

Let me know what you all think, and I will check in on this thread later. And please do not complain that I have not put up a binary and/or source yet. I will, just waiting for feedback from the topic starter.

The libraries I have used are windows specific, so this solution will most likely not work for any other OS at this point.


Title: Re: Bounty: Play sound file when block is generated
Post by: sethsethseth on May 13, 2011, 09:37:59 AM
How does a month go by and then suddenly three people try to do this in one day!  TheManOfTown's method seems to be the best, as it works with any miner and multiple mining rigs on the eligius pool.  Testing it now shipping coins back and forth to roommates computers to hear the action.  if you guys have good sounds post them.


Title: Re: Bounty: Play sound file when block is generated
Post by: Herodes on May 13, 2011, 11:33:50 AM
It should now work as follows.

1. When "0/unconfirmed" shows up the first time for a transaction sound recieved.wav is played.
2. When coins are generated and show up in the client with 120 block left before mature, sound should be played (generated.wav).

If sounds needs to be swapped, find a wave file and replace the original.

1. Is confirmed to be working.
2. Seth is testing if the generated sound behaves as planned.


Title: Re: Bounty: Play sound file when block is generated
Post by: shooter_mcgavin on May 13, 2011, 12:40:11 PM
I have now implemented the request feature, compiled a client binary for win 7 64 bit, and e-mailed it to seth. I talked with him on irc earlier on. Later I might submit this as a patch to the official client if anyone is interested. It wasn't a big job at all, when I first got to coding, but setting up the entire environment for compiling took a long time.

As it is now, it checks for "0/unconfirmed", and once that message pops up in the client, the client will play a sound of your choice. Currently this is just a file named test.wav in your directory. I have just tested it on my win 7 64 bit system, and the only files altered are the ui.cpp and the makefile.

Not sure if more people are interested, then let me know, and I may put out the source. I will at some point anyhow, but I tought I'd refine it a bit more, even if it works now.

There is a glitch tough, the send coin menu item and the adress book item seems to no longer behave perfectly graphically speaking, sometimes when moving the client around the screen, or resizing it, the graphic in the menu line is affected and looks a bit odd, I don't know why this is, but will research it later on.

Complete source is available for the topic starter, and also instructions for how to set up the environment for compiling were sent to him, although I must frankly say that these procedures are a bit daunting for a non-programmer.

Let me know what you all think, and I will check in on this thread later. And please do not complain that I have not put up a binary and/or source yet. I will, just waiting for feedback from the topic starter.

The libraries I have used are windows specific, so this solution will most likely not work for any other OS at this point.

If the only activity you have in your wallet is from mining, then this is acceptable, however, if someone sends you an arbitrary transaction, it may give you a false positive..


Title: Re: Bounty: Play sound file when block is generated
Post by: Herodes on May 13, 2011, 10:34:33 PM
If the only activity you have in your wallet is from mining, then this is acceptable, however, if someone sends you an arbitrary transaction, it may give you a false positive..

The code has been modified to fulfill the needs of the original poster, Seth, and since changed by his requests so it behaves according to his tastes. I am awaiting his responses as to whether he's satisfied with the solution or not, so far it seems like he's happy with the results.



Title: Re: Bounty: Play sound file when block is generated
Post by: unfinishe on May 13, 2011, 10:39:21 PM
Oh well. I guess I'm glad someone made a better system than me.


Title: Re: Bounty: Play sound file when block is generated
Post by: sethsethseth on May 14, 2011, 07:18:46 PM
It should now work as follows.

1. When "0/unconfirmed" shows up the first time for a transaction sound recieved.wav is played.
2. When coins are generated and show up in the client with 120 block left before mature, sound should be played (generated.wav).

If sounds needs to be swapped, find a wave file and replace the original.

1. Is confirmed to be working.
2. Seth is testing if the generated sound behaves as planned.

Power was out at my house a bunch yesterday, so havent been able to generate on eligius pool to verify this works, but one should generate within a few hours now.  The receive.wav sound plays for receiving OR sending though.  Now that I think about it, it would be awesome if it played a send.wav sound when I send, but that wasn't in the original specs so up to you if you want to add that.


Title: Re: Bounty: Play sound file when block is generated
Post by: Herodes on May 15, 2011, 12:03:33 AM
Yes, I could add that. And I am aware it plays the sound also when sending. Another check needs to be put in for another soundfile to play at that moment. I am in crunch mode at another project right now, so I could add the send.wav feature in a few days. Lemme know how it works out with that generated bit. I asume it should work, but it is always nice to test it to verify that it actually works as planned. No worries, power outages or net outages happens.


Title: Re: Bounty: Play sound file when block is generated
Post by: sethsethseth on May 15, 2011, 12:46:57 AM
Got a generation and unfortunately I didn't pay as much attention to what happened as i should have.  The sound played, I looked at the client, it didn't show any new generation, then I ran off to do something and looked at it again in 2 minutes and there was a 2/unconfirmed generation.  So I'm guessing the code must be interfering with the screen draw while it says 0/unconfirmed.  I'll pay attention more closely on the next one....

Sent ya 5btc, I'll send the other 5 when this works good:)


Title: Re: Bounty: Play sound file when block is generated
Post by: Herodes on May 15, 2011, 02:59:49 AM
Yes, pay close attention to what happens and let me know how it works out. :)


Title: Re: Bounty: Play sound file when block is generated
Post by: sethsethseth on May 19, 2011, 03:05:21 AM
Testing of the generated coin part is going super slow cause the eligius pool is paying us in huge chunks instead of every block...  This is definitely the best feature ever though:)