Life In 19x19
http://prod.lifein19x19.com/

Missing Stone sound resolved (and sound mixing on Linux)
http://prod.lifein19x19.com/viewtopic.php?f=24&t=7441
Page 1 of 1

Author:  C. Blue [ Sun Dec 16, 2012 11:26 am ]
Post subject:  Missing Stone sound resolved (and sound mixing on Linux)

I had a look at CGoban and hacked it a bit to make the stone sound use the same sound system as the perfectly working pass sound.
Fortunately that wasn't hard, because it is basically just copy/paste (take pass sound code, insert at stone sound code, replacing it), takes maybe 10 minutes.

As a nice side effect, the sound now works on Linux systems without any wrappers (aoss/padsp) even with soundcards that don't have hardware mixing (provided you use OpenJDK 7 which supports softwaremixing via ALSA, dunno about Oracle Java).

While on it, I also added a volume slider for the stone/pass sound effects, since it was pretty loud in certain teaching games compared to the teacher's voice ;).
Unfortunately, WMS has expressed in the past that he does not want any "custom-modified" clients to be released publicly, or he might ban people, so I cannot offer it for download.

If you want to modify your own client though, assuming you have decompiled source code, just search for the "pass.au" sound, copy/paste the line that loads it to do the same with the "stone.au" sound, and check the next 'if' command below that. It's the one that decides whether to play a pass or a stone sound. The 'else' bracket is the stone sound, there you can replace the a.b(0).c() method which calls the sound the old way by code you can easily derive from how "pass.au" is loaded: You'll end up with a simple line "yourstonesound.play();", exactly as with the pass sound.
Don't forget to declare a "private static AudioClip yourstonesound = null;" in the beginning, same as is done for the pass sound. It's really all just copy/pasting. ^^
(The "import java.applet.AudioClip;" is already there since it's used for the pass sound, so you don't need to add anything else. Yay!)

Author:  duckweed [ Fri Dec 21, 2012 6:50 am ]
Post subject:  Re: Missing Stone sound resolved (and sound mixing on Linux)

Wow! You fixed the unfixable sound bug.

I hope wms can implement your fix soon ...

Author:  kaseki [ Tue Feb 05, 2013 10:43 am ]
Post subject:  Re: Missing Stone sound resolved (and sound mixing on Linux)

Not being able to keep of with everything everywhere, this was a surprise when I changed from Ubuntu 10.04.1 to Linux Mint 14 yesterday, found I heard the pass squawk but not the stone click.

Installing various versions of Java, known relentless security hazards that they are, is not an acceptable option. The latest IcedTea OpenJDK works fine otherwise as far as I can tell.

Disassembling the Cgoban3 source code would be a pain for me, and probably violates some TOS that I might have agreed to as some point.

I'll have to attempt the aoss trick when I next get time.

Fortunately for KGS, I had already paid for KGS+ to support them before I discovered that this problem is a long festering sore that has, as seen above, a straightforward patch that will be hard to describe as an unaffordable software repair operation, as the patched version could be supplied for Linux only and regression testing on Windows could be avoided.

Otherwise, I will note that both the jar and jnlp approaches to running Cgoban3 work fine from the menu, once one finds the paths and shrinks the icon to a 48 x 48 pixel size in png format. The java web start option, however, does spawn a new cache folder hierarchy each time it is run.

kas

Author:  kaseki [ Tue Feb 05, 2013 11:20 pm ]
Post subject:  Re: Missing Stone sound resolved (and sound mixing on Linux)

Alternative resolution.

Rather than hacking the source code, I used the "big ugly hack" that Nick23 documented in post 29 in the thread: stone clicking sound missing - windows 7.

The only difference is that for Linux Mint 14 Cinnamon, there are four folders after /jvm, each with a /jre. I chose the folder /java-1.7.0-openjdk-i386 to put the package into. Both stone click and pass squawk are generated for the Cgoban3 jar file. However, starting the jnlp with java web start led to no stone sound. Perhaps one of the other three folders under /jvm is being used by jws. The web start mode is less critical for me, so I'll look into it further when I have time.

kas

Author:  kaseki [ Sat Feb 09, 2013 7:52 am ]
Post subject:  Re: Missing Stone sound resolved (and sound mixing on Linux)

Java web start downloads new instances of Cgoban into new folder hierarchies, so each new instance wouldn't have a way to be exposed to the Big Ugly Hack package. However, that is not all bad; I have found that I need to use this mode to hear the sensei on recorded lectures.

kas

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/