iamLovingJerk / pychess

Automatically exported from code.google.com/p/pychess
GNU General Public License v3.0
0 stars 0 forks source link

Which sounds do we need #132

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Many chessclients offer to play a sound when some event happens.

I think the user interface should look like the gnome-sound-properties one,
but the question is which events to support.

The eboard ones:
 # Opponent Moved
 # Draw Offered
 # Private Tell
 # ICS Challenge
 # Time Running Out
 # Game Won
 # Game Lost
 # Game Started
 # Observed Game Ended
 # Move made (Observed Game)

The arena ones:
 # At a check
 # At a normal move
 # At a capture move
 # When new board is set-up
 # When won
 # When lost
 # At a draw
 # At the start of Arena

I think the sounds could be played using gstreamer-python, which is a
gnome-dependency, at least from gnome 2.18.

Original issue reported on code.google.com by lobais on 3 Jan 2007 at 9:11

GoogleCodeExporter commented 9 years ago
using python stardart library as this:

import wave, ossaudiodev

try:
    wv = wave.open('test.wav','rb')
    num_ch, samp_width, frmrate, nframes, cptype, cpname = wv.getparams()
    try:
        fl = ossaudiodev.open("/dev/dsp", "rw")
        fl.setparameters(ossaudiodev.AFMT_S16_LE, num_ch, frmrate)
        fl.writeall(wav.readframes(nframes))
    finally:
        fl.close()
finally:
    wv.close()

but, will be placed a different sound for each action?

best regards,
leonardo.

Original comment by leogregianin@gmail.com on 31 Jan 2007 at 12:03

GoogleCodeExporter commented 9 years ago
If you grab the 0.7 branch:
svn checkout http://pychess.googlecode.com/svn/branches/0.7/ pychess
You can take a look at the gui in Preferences -> Preferences -> Sounds. Which is
supposed to be the place to set up different sounds (or no sound) for each 
action.

Your standard library code looks good. Also in the way that it won't make us 
depend
on gstreamer. On the other hand it won't be able to play ogg's and stuff.

Perhaps we should test if the user has gstreamer available, and if he doesn't 
we fail
back to allow only system beep and wav files.

It would be good to take the coding discussion somewhere else though, as this 
thread
should focus on deciding for which actions it should be possible to assign 
sounds.

Original comment by lobais on 31 Jan 2007 at 3:27

GoogleCodeExporter commented 9 years ago
I think we'd just go for

A player moves
A player checks
A player captures
-------------------
Game is set-up
Game is won
Game is lost
Game is drawn
-------------------
Observed moves
Observed ends

At least for Philidor.

Original comment by lobais on 16 Jun 2007 at 4:52