Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 29 30 [31] 32 33 ... 105

Author Topic: SoundSense: a sound engine for dwarf fortress.  (Read 577658 times)

DrKillPatient

  • Bay Watcher
  • The yak falls infinitely
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #450 on: May 31, 2011, 09:49:21 pm »

You made a typo and missed a quote on the revised version, also, it seemed to have a strange formatting that made Linux not read it right-- this version, which I fixed up a bit, works for me on Linux Mint 10:
Quote
#!/bin/sh
dir=${0%/*}
if [ -d "$dir" ]; then
 cd "$dir"
fi
CLASSPATH='soundSense.jar:lib/MP3SPI/mp3spil.9.4.jar:lib/MP3SPI/jl1.0.jar:lib/OGGSPI/jogg-0.0.7.jar:lib/OGGSPI/jorbis-0.0.15.jar:lib/OGGSPI/vorbisspil.0.3.jar:lib/tritonus_share.jar:lib/autoUpdater.jar:lib/commons-codec-1.4/commons-codec-1.4.jar'
if [ -e /urs/bin/aoss/ ] ; then
 aoss java -Djava.util.logging.config.file=logging.properties -cp $CLASSPATH cz.zweistein.df.soundsense.SoundSense
else
 java -Djava.util.logging.config.file=logging.properties -cp $CLASSPATH cz.zweistein.df.soundsense.SoundSense
fi

EDIT: Damn it. The interface starts up, and sounds are being recognised, but whenever one should play, the terminal gives me this:
Quote
31/05/2011 10:02:30.005: The {silver war hammer} has lodged firmly in the wound! <-- that takes some strength, eh
31/05/2011 10:02:30.009: Dwarf 9 has been struck down.
31/05/2011 10:02:30.011: Exception with ./packs/deaths/WilhelmScream_vbr.mp3: javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file: could not get audio input stream from input file
« Last Edit: May 31, 2011, 10:05:16 pm by DrKillPatient »
Logged
"Frankly, if you're hanging out with people who tell you to use v.begin() instead of &v[0], you need to rethink your social circle."
    Scott Meyers, Effective STL

I've written bash scripts to make using DF easier under Linux!

zwei

  • Bay Watcher
  • [ECHO][MENDING]
    • View Profile
    • Fate of Heroes
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #451 on: June 01, 2011, 07:54:49 am »

EDIT: Damn it. The interface starts up, and sounds are being recognised, but whenever one should play, the terminal gives me this:
Quote
31/05/2011 10:02:30.005: The {silver war hammer} has lodged firmly in the wound! <-- that takes some strength, eh
31/05/2011 10:02:30.009: Dwarf 9 has been struck down.
31/05/2011 10:02:30.011: Exception with ./packs/deaths/WilhelmScream_vbr.mp3: javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file: could not get audio input stream from input file

Thanks for fixed script, i shall include that in next verion.

As for "UnsupportedAudioFileException", it seems to be bug with openjdk - could you try installing sun java?

Thundercraft

  • Bay Watcher
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #452 on: June 01, 2011, 02:02:09 pm »

...adventurer combat messages are not fully implemented (notably, messages related to player character doing something).
Are these combat messages being worked on still?

Also, I remember a while ago you mentioned that it's currently not possible to have a lot of sounds in Adventure Mode because many of the events exclusive to Adventure Mode are resolved in chat, rather than put in the game log, where SoundSense could detect them. (See the Logging improvement thread for details.) I believe I may have stumbled across a method to resolve part of this problem.

Specifically, the "announcements.txt" file found in the "...\data\init\" folder seems to tell the game whether to output game messages to the adventure or dwarf announcements log, the combat report log, a message box which pops up on screen, etc.
Quote
BOX or DO_MEGA: the announcment will appear in a box and pause the game
P or PAUSE: the announcement will cause the game to pause
R or RECENTER: the announcement will cause the game to recenter (if possible)
A_D or A_DISPLAY: the announcement will be displayed in the main adventure announcement log (and on screen)
D_D or D_DISPLAY: the announcement will be displayed in the main dwarf announcement log (and at the bottom)
UCR or UNIT_COMBAT_REPORT: the announcement will be associated to the unit combat/hunting/sparring reports
UCR_A or UNIT_COMBAT_REPORT_ALL_ACTIVE: the announcement will be associated to any active unit combat/hunting/sparring reports, but if there are no reports it will not create one

Couldn't this file be adjusted so that more useful events are put in the game log, allowing SoundSense to detect more stuff?  ???
Logged

nenjin

  • Bay Watcher
  • Inscrubtable Exhortations of the Soul
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #453 on: June 01, 2011, 02:15:14 pm »

Planning on adding any new music or sfx for the cities and under-cities?
Logged
Cautivo del Milagro seamos, Penitente.
Quote from: Viktor Frankl
When we are no longer able to change a situation, we are challenged to change ourselves.
Quote from: Sindain
Its kinda silly to complain that a friendly NPC isn't a well designed boss fight.
Quote from: Eric Blank
How will I cheese now assholes?
Quote from: MrRoboto75
Always spaghetti, never forghetti

DrKillPatient

  • Bay Watcher
  • The yak falls infinitely
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #454 on: June 01, 2011, 07:38:15 pm »

I've got sun-java6 and openjdk-6-jre installed already. Anything else I could try as a fix?
« Last Edit: June 01, 2011, 07:44:13 pm by DrKillPatient »
Logged
"Frankly, if you're hanging out with people who tell you to use v.begin() instead of &v[0], you need to rethink your social circle."
    Scott Meyers, Effective STL

I've written bash scripts to make using DF easier under Linux!

nomad_delta

  • Bay Watcher
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #455 on: June 01, 2011, 08:48:15 pm »

I gotta say, I thought this was a totally silly idea until I tried it and found that it's incredibly useful and super awesome.  Keep up the good work.   :P

--nomad_delta
Logged

zwei

  • Bay Watcher
  • [ECHO][MENDING]
    • View Profile
    • Fate of Heroes
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #456 on: June 02, 2011, 01:55:16 am »

I've got sun-java6 and openjdk-6-jre installed already. Anything else I could try as a fix?

Check where your path points - if it points to openjdk binaries, redirect it to sun java.

...adventurer combat messages are not fully implemented (notably, messages related to player character doing something).
Are these combat messages being worked on still?

Also, I remember a while ago you mentioned that it's currently not possible to have a lot of sounds in Adventure Mode because many of the events exclusive to Adventure Mode are resolved in chat, rather than put in the game log, where SoundSense could detect them. (See the Logging improvement thread for details.) I believe I may have stumbled across a method to resolve part of this problem.

Specifically, the "announcements.txt" file found in the "...\data\init\" folder seems to tell the game whether to output game messages to the adventure or dwarf announcements log, the combat report log, a message box which pops up on screen, etc.
Quote
BOX or DO_MEGA: the announcment will appear in a box and pause the game
P or PAUSE: the announcement will cause the game to pause
R or RECENTER: the announcement will cause the game to recenter (if possible)
A_D or A_DISPLAY: the announcement will be displayed in the main adventure announcement log (and on screen)
D_D or D_DISPLAY: the announcement will be displayed in the main dwarf announcement log (and at the bottom)
UCR or UNIT_COMBAT_REPORT: the announcement will be associated to the unit combat/hunting/sparring reports
UCR_A or UNIT_COMBAT_REPORT_ALL_ACTIVE: the announcement will be associated to any active unit combat/hunting/sparring reports, but if there are no reports it will not create one

Couldn't this file be adjusted so that more useful events are put in the game log, allowing SoundSense to detect more stuff?  ???

Adventure mode is in hiatus - I do not really play it, so if anyone wants to go forward and expand it, feel free to do so.

Most missing messages are already known from dwarf mode, only disticntion being You vs. He.: "You vomit!" instead of descriptive "Urist Vomits!" from dwarf mode. It is low hanging fruit, but takes some time.

---

For meeting foe messages - this applies to dwarf mode, adventurer meeting banding leader or dragon is resolved in chat, as noted before, so this will not help.

zwei

  • Bay Watcher
  • [ECHO][MENDING]
    • View Profile
    • Fate of Heroes
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #457 on: June 04, 2011, 06:21:08 am »

New Release:

http://df.zweistein.cz/soundsense/soundSense_29_137.zip

Changes:
* fixed linux startup script
* you can now reload soundpack without restarting soundsense, just click fairly obvious button :)
* you can now control stereo balance of sound - randomBalance="true" attribute of soundFile to help with making stuff a bit more atmospheric, added this to several apropriate places in soundpack.

Also, new soundpack taking advantage of new feature is up, via full download and autoUpdate.

arclance

  • Bay Watcher
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #458 on: June 04, 2011, 04:36:35 pm »

I had the same problem.
Quote
EDIT: Damn it. The interface starts up, and sounds are being recognised, but whenever one should play, the terminal gives me this:
Quote
    31/05/2011 10:02:30.005: The {silver war hammer} has lodged firmly in the wound! <-- that takes some strength, eh
    31/05/2011 10:02:30.009: Dwarf 9 has been struck down.
    31/05/2011 10:02:30.011: Exception with ./packs/deaths/WilhelmScream_vbr.mp3: javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file: could not get audio input stream from input file
I found that you need to install this plugin http://www.oracle.com/technetwork/java/javase/download-137625.html to enable sun java to play mp3 files in Linux. 
I also had to run dos2unix on soundSense.sh from the newest version of Soundsense because of this error.
Quote
./soundSense.sh
bash: ./soundSense.sh: /bin/sh^M: bad interpreter: No such file or directory
Soundsense is working fine for me now.
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

DrKillPatient

  • Bay Watcher
  • The yak falls infinitely
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #459 on: June 06, 2011, 05:46:03 pm »

Where do I put the plugin to get Java to use it? The instructions aren't particularly clear on that page.
Logged
"Frankly, if you're hanging out with people who tell you to use v.begin() instead of &v[0], you need to rethink your social circle."
    Scott Meyers, Effective STL

I've written bash scripts to make using DF easier under Linux!

arclance

  • Bay Watcher
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #460 on: June 06, 2011, 08:33:00 pm »

The java executable you point sound sense too should be in a folder called bin inside of the directory SunJava was Installed/Extracted to.
If you used the download from the SunJava webpage the Soundsense readme sends you too you decided where is was installed.
If you installed SunJava as a package you can find its install directory using.
Quote
sudo update-alternatives --config java
This will give you a list of all the java pakages you have installed and the full path to the directory they are installed in.
It should look like this.
Quote
sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                      Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      auto mode
  1            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode
* 2            /usr/lib/jvm/java-6-sun/jre/bin/java       63        manual mode

Press enter to keep the current choice
  • , or type selection number:
 
It will let you change which java installation to use as the system default if you want.  Just hit enter if you don't want to change that setting.
I my case this pointed to a shortcut to a different folder in the same directory where SunJava was actually installed, which had a java executable that was a shortcut to the real java executable.
Follow the shortcuts until you find the java executable that is not a short cut.
Up one directory level from the java executable should be several folders named things like bin, lib, plugin, ect.
This is where you want to extract the contents of the zip file that contains the plugin.  You will need to be a super user to copy files to this directory.
If you want to do this using a gui use.
Quote
sudo nautilus
   
It will open a new file explorer window as a super user and let you copy the files with the new window only.
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

DrKillPatient

  • Bay Watcher
  • The yak falls infinitely
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #461 on: June 06, 2011, 09:08:29 pm »

Seems to have improved something, but now I get this instead:
Quote
06/06/2011 09:07:12.157: Exception with ./packs/mandates/34209__acclivity__ClearingThroat_Female.mp3: java.lang.IllegalArgumentException: Mute not supported: Mute not supported
Logged
"Frankly, if you're hanging out with people who tell you to use v.begin() instead of &v[0], you need to rethink your social circle."
    Scott Meyers, Effective STL

I've written bash scripts to make using DF easier under Linux!

arclance

  • Bay Watcher
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #462 on: June 06, 2011, 10:03:07 pm »

I had that too at some point.  It happened after I restarted when I was using the manual install of the java runtime environment version 6.25 from the SunJava website.
I then installed a SunJava6 package which was version 6.24 and intalled the mp3 plugin to this install.
I made this the system default java install but Soundsense did not work with the default soundSense.sh file.
I think the problem was that the system default was pointed to a shortcut to the real java executable and Soundsense is not handeling this properly.
I solved this by specifying the full path to the non shortcut java exececutable in soundSense.sh like this.
Quote
#!/bin/sh
dir=${0%/*}
if [ -d "$dir" ]; then
 cd "$dir"
fi
CLASSPATH='soundSense.jar:lib/MP3SPI/mp3spil.9.4.jar:lib/MP3SPI/jl1.0.jar:lib/OGGSPI/jogg-0.0.7.jar:lib/OGGSPI/jorbis-0.0.15.jar:lib/OGGSPI/vorbisspil.0.3.jar:lib/tritonus_share.jar:lib/autoUpdater.jar:lib/commons-codec-1.4/commons-codec-1.4.jar'
if [ -e /urs/bin/aoss/ ] ; then
 aoss java -Djava.util.logging.config.file=logging.properties -cp $CLASSPATH cz.zweistein.df.soundsense.SoundSense
else
 /usr/lib/jvm/java-6-sun-1.6.0.24/jre/bin/java -Djava.util.logging.config.file=logging.properties -cp $CLASSPATH cz.zweistein.df.soundsense.SoundSense
fi
Have you done so?
If you have not this is what you should do.
If I remember correctly I got this error even with java-6-sun set as the system java default until I added the full path to the java executable in soundSense.sh. 
The path on my system is shown in red, you should replace it with the full path the the java executable from you SunJava6 install.
If you have a java installation in a directory starting with /urs/bin/aoss/ soundSense.sh defaults to that (because of the if statement). 
If your java install is here you should repalce both the blue and red text in my example with the full path the the java executable from you SunJava6 install.   
Let me know if that helps.

zwei

On Ubuntu 11.04 installed as outlined in my previous posts I get the following error message in the the terminal when a file plays.
Quote
06/06/2011 10:24:58.741: Balance control not supported for ./packs/mandates/34209__acclivity__ClearingThroat_Female.mp3!
The file plays at the correct time and sounds fine.
I looks like there is something wrong with the new stero balance feature in linux.
« Last Edit: June 06, 2011, 10:31:28 pm by arclance »
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

zwei

  • Bay Watcher
  • [ECHO][MENDING]
    • View Profile
    • Fate of Heroes
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #463 on: June 07, 2011, 01:07:11 am »

Seems to have improved something, but now I get this instead:
Quote
06/06/2011 09:07:12.157: Exception with ./packs/mandates/34209__acclivity__ClearingThroat_Female.mp3: java.lang.IllegalArgumentException: Mute not supported: Mute not supported

Every device should support mute according to specs. I am baffled, but I can simply turn this off for systems that do not support it.

On Ubuntu 11.04 installed as outlined in my previous posts I get the following error message in the the terminal when a file plays.
Quote
06/06/2011 10:24:58.741: Balance control not supported for ./packs/mandates/34209__acclivity__ClearingThroat_Female.mp3!
The file plays at the correct time and sounds fine.
I looks like there is something wrong with the new stero balance feature in linux.

It can be that, but it also could be that source file is mono - it is kinda bizare, but sound api can not position mono tracks. This can be remedied by converting mp3s to stereo.

I guess I will expand error message to be more informative if source track is mono.

(Also, thanks a lot for helping out with Linux issues!)

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #464 on: June 07, 2011, 01:51:52 am »

Ubuntu treats Java weirdly and you need to *select* which java implementation to use if you have multiple installed.

See: http://www.linuxcandy.com/2011/04/installing-java-in-ubuntu-made-easy-how.html

The part with 'sudo update-alternatives --config java' is particularly important. Just disable the weird java forks and use the one from sun/oracle.
Pages: 1 ... 29 30 [31] 32 33 ... 105