Bitcoin Forum
March 23, 2017, 06:26:17 AM *
News: Latest stable version of Bitcoin Core: 0.14.0  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Sound effects  (Read 947 times)
Hal
VIP
Sr. Member
*
expert
Offline Offline

Activity: 314



View Profile
January 15, 2011, 08:26:20 PM
 #1

I finally got around to building my own client from source (on Ubuntu) and the first thing I did was to add sound effects. I now hear a little pop whenever there's a transaction, and a chime when there's a new block.

It was easy, here's the diff for main.cpp, just 3 lines:

Code:
diff --git a/main.cpp b/main.cpp
index b7dfd9f..1196520 100644
--- a/main.cpp
+++ b/main.cpp
@@ -4,6 +4,7 @@
 
 #include "headers.h"
 #include "cryptopp/sha.h"
+#include "wx/sound.h"
 
 
 
@@ -2575,6 +2576,7 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
 
     else if (strCommand == "tx")
     {
+wxSound::Play("snd_tx.wav");
         vector<uint256> vWorkQueue;
         CDataStream vMsg(vRecv);
         CTransaction tx;
@@ -2628,6 +2630,7 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
 
     else if (strCommand == "block")
     {
+wxSound::Play("snd_blk.wav");
         CBlock block;
         vRecv >> block;

For snd_tx.wav I used http://www.series-of-articles.com/sfx/snd/pop.wav; for snd_blk.wav I used http://www.series-of-articles.com/sfx/snd/bell.wav.

A quick hack, but entertaining and informative.

Hal Finney
1490250377
Hero Member
*
Offline Offline

Posts: 1490250377

View Profile Personal Message (Offline)

Ignore
1490250377
Reply with quote  #2

1490250377
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1490250377
Hero Member
*
Offline Offline

Posts: 1490250377

View Profile Personal Message (Offline)

Ignore
1490250377
Reply with quote  #2

1490250377
Report to moderator
1490250377
Hero Member
*
Offline Offline

Posts: 1490250377

View Profile Personal Message (Offline)

Ignore
1490250377
Reply with quote  #2

1490250377
Report to moderator
1490250377
Hero Member
*
Offline Offline

Posts: 1490250377

View Profile Personal Message (Offline)

Ignore
1490250377
Reply with quote  #2

1490250377
Report to moderator
caveden
Legendary
*
Offline Offline

Activity: 1106



View Profile
January 15, 2011, 08:59:07 PM
 #2

Nice!

Could you make it configurable? This way, I think you could easily submit your patch, there's no reason to refuse these kind of things.

18rZYyWcafwD86xvLrfuxWG5xEMMWUtVkL
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!