xboard and sound files

Discussions about the WinBoard protocol. Here you can also report bugs and request new features.

Moderators: hgm, Andres Valverde

xboard and sound files

Postby bodiless » 18 Jul 2009, 09:10

Fist of all I would like to introduce myself to the forum. I knew xboard from when I switched to linux since a few years now but never read the man pages carefully so I didn't appreciated its features very much. But recently I rediscovered it mainly because I was bored of using jin or other windows interfaces with wine. At the moment I am really amazed with its performance and I assure you it will be my chess interface for a while. So I hope being around here quit often.

Now, lets go to the point...I figured out how to make sounds work. But when I put a line in my ~/XBoard like
Code: Select all
xboard*soundMove: /home/nikos/.home_transf/chess/move.wav >&/dev/null

I get all the sound file information displayed in the console, everytime a sound is played (moves, announchments etc). This is how it looks like:
Code: Select all
fics%
Input File     : '/home/nikos/.home_transf/chess/move.wav'
Sample Size    : 8-bit (1 byte)
Sample Encoding: unsigned
Channels       : 1
Sample Rate    : 8000

Time: 00:00.10 [00:00.00] of 00:00.10 (100% ) Samples out: 4.91k Clips: 15   
play effects: resample clipped 15 samples; decrease volume?
Done.

This is very annoying because if you play a blitz game you get a lot of these sound file information and the text in the terminal scrolls very fast so you actually can't read anything else.

If I then pass the argument >&/dev/null at the end of the command then the sound is not being played. I get:
Code: Select all
fics% play soxio: Can't open input file `/home/nikos/.home_transf/chess/move.wav >&/dev/null': No such file or directory

I assume that this must be an xboard problem because if I just play the sound in a console with:
Code: Select all
 play /home/nikos/.home_transf/chess/move.wav >&/dev/null

it is being played correctly. But I may be wrong.

By the way I shaw a similar bug for eboard here. I don't know if they are related though.

Finally in case that matters I am using debian lenny amd64

So are there any thought on this?

Thanks
bodiless
 
Posts: 9
Joined: 17 Jul 2009, 22:03

Re: xboard and sound files

Postby Eric Mullins » 18 Jul 2009, 17:03

bodiless wrote:Now, lets go to the point...I figured out how to make sounds work. But when I put a line in my ~/XBoard like
Code: Select all
xboard*soundMove: /home/nikos/.home_transf/chess/move.wav >&/dev/null


If that actually works, then change it to:
Code: Select all
xboard*soundMove: <path>/move.wav 2>/dev/null


which will redirect stderr instead of stdout.

What I do instead, though is:

Code: Select all
xboard*soundMove: <path>/move.wav
xboard*soundProgram: aplay -q


The redirection should work anywhere, so you should be able to do this too, which might be the most compatible. My current version of play appears to have the '-q' option, but IIRC, it didn't used to thave that.
Code: Select all
xboard*soundMove: <path>/move.wav
xboard*soundProgram: play 2>/dev/null
Eric Mullins
 
Posts: 47
Joined: 28 Aug 2008, 04:54
Location: Albuquerque, NM

Re: xboard and sound files

Postby bodiless » 18 Jul 2009, 18:36

Great thanks, the
Code: Select all
xboard*soundProgram: play 2>/dev/null

did the trick
bodiless
 
Posts: 9
Joined: 17 Jul 2009, 22:03

Re: xboard and sound files

Postby rigao » 18 Jul 2009, 21:30

I thought it was impossible to hear sounds in xboard... I didn't know where I rode (past tense of read¿? I don't know if it is rode or read) it.

Anyway, where I'm supposed to write xboard*soundMove:..... in the terminal before xboard is started? after? In some config file?

If it is before, it didn't work, and if it is after, it didn't work either...
rigao
 
Posts: 63
Joined: 14 Dec 2008, 17:33

Re: xboard and sound files

Postby Eric Mullins » 18 Jul 2009, 22:37

rigao wrote:Anyway, where I'm supposed to write xboard*soundMove:..... in the terminal before xboard is started? after? In some config file?


You place xboard's X resources in .Xresources (I still use .Xdefaults because that works on my machine, but technically, .Xdefaults is obsolete), or in ~/XBoard.

I'm not sure when ~/XBoard is parsed. But if you want changes in .Xresources to take effect, you can either logout/login, or:
Code: Select all
xrdb -merge ~/.Xresources
Eric Mullins
 
Posts: 47
Joined: 28 Aug 2008, 04:54
Location: Albuquerque, NM

Re: xboard and sound files

Postby rigao » 18 Jul 2009, 23:04

Great. It just worked great.

I had no .Xresources file in my home directory, so I created it from scratch (In my windows manager, thunar, just go to create new, and I named it .Xresources, and placed it in /home/user/) and edited with abiword, writed down the following:

xboard*soundShout: shout.wav
xboard*soundSShout: sshout.wav
xboard*soundChannel1: channel1.wav
xboard*soundChannel: channel.wav
xboard*soundKibitz: kibitz.wav
xboard*soundTell: tell.wav
xboard*soundChallenge: challenge.wav
xboard*soundRequest: request.wav
xboard*soundSeek: seek.wav
xboard*soundMove: move.wav
xboard*soundIcsWin: win.wav
xboard*soundIcsLoss: lose.wav
xboard*soundIcsDraw: draw.wav
xboard*soundIcsUnfinished: unfinished.wav
xboard*soundIcsAlarm: alarm.wav

which I found in the xboard help, but instead of move.wav, /home/user/Sounds/move.wav, where I actually have all the sounds which come with the sources of xboard.

After that,

xrdb -merge ~/.Xresources

made the trick.

One last question I have, is that I hear the sound of my opponent move, but my move does not have sound. I would like my move to sound, too, can I do this too?
rigao
 
Posts: 63
Joined: 14 Dec 2008, 17:33

Re: xboard and sound files

Postby bodiless » 19 Jul 2009, 08:31

Hey rigao,

did you actually get some sound files when you installed the program? I did not, at least I couldn't find them anywhere on my system, so what I did is I downloaded some sound files from the Internet. But I would actually see/hear the original xboard sound files if they exist. Also because I couldn't find any wav files for some sounds like sshout etc.

Regarding the original subject of the post I placed all the configurations in a ~/XBoard file because I was reading all these about .Xdefaults not being used any more and it works great.

Don't know about hearing your own move sound
bodiless
 
Posts: 9
Joined: 17 Jul 2009, 22:03

Re: xboard and sound files

Postby rigao » 19 Jul 2009, 12:06

I downloaded the source files instead of the debian installer. There's the link

http://git.savannah.gnu.org/cgit/xboard.git/

there I download the last sources and there is a sound directory :) When you copy it to wherever you want, you can delete it, as you have it installed already.

I think there are the last sources you can find, and you don't need to wait for any1 to make the installer for you.
rigao
 
Posts: 63
Joined: 14 Dec 2008, 17:33

Re: xboard and sound files

Postby H.G.Muller » 21 Jul 2009, 11:35

For some reason the binary Debian package (from which the Ubuntu package is derived) does not include any sount files. Now I agree that many of the sounds in the source tree sounds directory are not very worthwile: they are just spoken short phrase like "kibitzes" or "game unfinished". It would be nice to have some sounds included by default, though, if only to wake people up to the fact that sounds are possible. And when you are operating a chess program at a tournament it is really a world of difference having to deal with a totally mute GUI (having to watch the display continuously for a new move), and having one that can make a sound. It doesn't matter what; any sound will do to attract your attention. Gong is best, og course! :D

To have distictive -soundBell and -soundMove is definitely useful, and now that I use -soundIcsUnfinished for illegal moves, a different .wav file for that would be useful too (I like the "penalty" sound for that.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: xboard and sound files

Postby vsoljan » 06 Aug 2010, 13:01

rigao wrote:One last question I have, is that I hear the sound of my opponent move, but my move does not have sound. I would like my move to sound, too, can I do this too?


This is what I am also trying to figure out, but no luck so far. Is it possible to have move sound for my moves too?
Please help!
vsoljan
 
Posts: 24
Joined: 28 Sep 2009, 14:15


Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 8 guests