Bay 12 Games Forum

Please login or register.

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

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

arclance

  • Bay Watcher
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #465 on: June 07, 2011, 02:13:23 am »

I took a look at some of the mp3 files.  So far none of them are mono.
I opened the file I posted the error for in Audacity and you can clearly see that it is stereo.
Spoiler (click to show/hide)
At least the files still play when this error comes up.

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.
I had to uninstall openjdk6 to make it use SunJava6 even though it was specified by 'sudo update-alternatives --config java' to use SunJava6 instead.
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

Thundercraft

  • Bay Watcher
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #466 on: June 07, 2011, 03:18:19 am »

The file plays at the correct time and sounds fine.
It looks like there is something wrong with the new stereo 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.

Please don't convert all the mono sounds to stereo if this can be avoided. That practically doubles the size of such files. :( And the SoundPack is already over 137 Mb... It's true that there are not many mono sounds right now. But when I get around to finishing my additions, there will be a bunch more.

Besides, from what I'm reading, the source being mono may not be the problem at all:
I took a look at some of the mp3 files.  So far none of them are mono.
I opened the file I posted the error for in Audacity and you can clearly see that it is stereo.
Spoiler (click to show/hide)
At least the files still play when this error comes up.
Logged

DrKillPatient

  • Bay Watcher
  • The yak falls infinitely
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #467 on: June 07, 2011, 05:34:32 pm »

Out of repairs come more errors unfortunately.
Quote
Exception with ./packs/battle/gore/85847__MWLANDI__Meat_Slap_3.mp3: javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 48000.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.: line with format PCM_SIGNED 48000.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian 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!

zwei

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

Out of repairs come more errors unfortunately.
Quote
Exception with ./packs/battle/gore/85847__MWLANDI__Meat_Slap_3.mp3: javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 48000.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.: line with format PCM_SIGNED 48000.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.

Okay, that is pretty f-up. This basically says: "I have succeded decompressing mp3 and sending data to operating system for playback, but it refused to play."

I think i need to have little word with whoever is responsible.

The file plays at the correct time and sounds fine.
It looks like there is something wrong with the new stereo 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.

Please don't convert all the mono sounds to stereo if this can be avoided. That practically doubles the size of such files. :( And the SoundPack is already over 137 Mb... It's true that there are not many mono sounds right now. But when I get around to finishing my additions, there will be a bunch more.

Besides, from what I'm reading, the source being mono may not be the problem at all:
I took a look at some of the mp3 files.  So far none of them are mono.
I opened the file I posted the error for in Audacity and you can clearly see that it is stereo.
Spoiler (click to show/hide)
At least the files still play when this error comes up.

mono is definitelly problem on windows, java sound api will refuse to apply ballance to mono sounds, you can try that for yourself.

If it refuses to balance stereo, well, damn. It should be able to do so without any complaining. Sigh.

And do not worry, I am not going to double size of soundpack pointlessly :-)

Thundercraft

  • Bay Watcher
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #469 on: June 08, 2011, 02:43:43 am »

Please don't convert all the mono sounds to stereo if this can be avoided. That practically doubles the size of such files. :( And the SoundPack is already over 137 Mb... It's true that there are not many mono sounds right now. But when I get around to finishing my additions, there will be a bunch more.
Besides, from what I'm reading, the source being mono may not be the problem at all...
mono is definitely problem on windows, java sound api will refuse to apply balance to mono sounds, you can try that for yourself.
...[snip]
And do not worry, I am not going to double size of soundpack pointlessly :-)
OK, I just tried out the newest release 29. And, yeah, that gives error messages about balance not being supported when playing mono files (any mono file, whether in mp3 format or not). I didn't realize that balance was a brand new feature. But I also noticed it can give the same type of error message for certain cases of stereo files. For example, the "Sword Strike And Clash-SoundBible.com-1345262316.mp3" sound in the [default] folder that comes with the SoundSense package is in stereo and it will give a balance error.

I noticed your "RandomBalance", "BalanceLeft", and "BalanceRight" examples in the [default] folder behaves as one would expect and with no error. So we know the balance feature can work if Java wants to behave itself. But I would not be surprised if the balance support of Java is either buggy or very, very particular. (I don't know. Perhaps it expects the input source to be within a certain range of volume or it expects it to be filtered or something?)

Here's an idea: Perhaps you could have SoundSense first determine whether a sound file to be played is mono or stereo and if it is mono, then it will skip trying to apply balance - only attempting to use it on stereo files?

Ah, perhaps you could have it so the balance code is normally disabled or bypassed and only enabled for sounds in the .xml file which have either randomBalance or balanceAdjustment applied to it?

Alternatively, since the files themselves seem to play and sound just fine whether they report an error about balance or not, perhaps you could just trap those error messages so they never appear in the SoundSense window? (Unless, of course, the ".level = ALL" line in the logging.properties file is edited to enable verbos output of debug messages.)

That's not really fixing the problem - just covering up the symptoms. However, if this is really due to buggy Java code, then there's probably not much you can do except complain to them. Or wait for them to fix this feature in some future release.
« Last Edit: June 08, 2011, 02:56:57 am by Thundercraft »
Logged

arclance

  • Bay Watcher
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #470 on: June 08, 2011, 09:40:58 am »

Out of repairs come more errors unfortunately.
Quote
Exception with ./packs/battle/gore/85847__MWLANDI__Meat_Slap_3.mp3: javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 48000.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.: line with format PCM_SIGNED 48000.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.
Have you installed a mp3 codec?  Linux does not come with one by default. 
If you have not installed one you can get this error because your OS has no way to play mp3 files.
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 #471 on: June 08, 2011, 05:33:02 pm »

My music player (Rhythmbox) can play mp3s fine, so I assume that's not the case... I'm using Mint 10, by the way. It's fairly close to Ubuntu.
« Last Edit: June 08, 2011, 05:40: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!

arclance

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

I may have found the source of some of the problems we have been having.
Some files were giving this error.
Quote
08/06/2011 08:42:51.528: Exception with ./packs/seasons/Peer Gynt - grieg - in the hall of the mountain king.mp3: javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file: could not get audio input stream from input file
The file plays in other audioplayers (banshee, smplayer, audacity, vlc, ect.).
I downloaded the original file indicated in attribution.txt to check if the file had be corrupted in some other way.  When I did this I found that the links given here are backwards.
Quote
Hey Di Lee Hi: http://lemill.net/content/pieces/piece.2007-11-18.9680846093

in the hall of the mountain king: http://www.bay12forums.com/smf/index.php?topic=57356.0
The file I downloaded from http://lemill.net/content/pieces/piece.2007-11-18.9680846093 was larger than the file in the soundpack and has a different md5 value.
I renamed the new file to match the one in the soundpack and replaced the soundpack file with it.
Soundsense was able to play the new file.
It looks like some of the files in the soundpack could be corrupted or have been altered by another program so that java can not play them.
So far the only other file that has given me this problem is this one.
Quote
08/06/2011 08:57:34.266: Exception with ./packs/seasons/spring2.mp3: javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file: could not get audio input stream from input file
I was not able to download the file from the link given in attribution.txt for this file so I can not check if the file is corrupt or not.
I redownloaded the soundpack to incase it had been corrupted during download and still had the same problem.

DrKillPatient
How did you install SunJava? 
If you installed using the download on the sunjava website where did you install it? 
If SunJava expects to be installed in the default java install directory and it is not it may not be able to find your mp3 codec.
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 #473 on: June 08, 2011, 10:29:34 pm »

It's installed through the package manager, called sun-java6 there. The startup script points to:
Quote
/usr/lib/jvm/java-6-sun/jre/bin/java
(this is the same place my OS is telling me it's loading java from, if I do sudo update-alternatives --config java)

And the mp3 plugin is in:
Quote
/usr/lib/jvm/java-6-sun/jre/lib/ext
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!

612DwarfAvenue

  • Bay Watcher
  • Voice actor.
    • View Profile
    • TESnexus profile, has my voice acting portfolio.
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #474 on: June 08, 2011, 10:47:13 pm »

Sorry to go off-topic here, but in the video you have on the original post showing Soundsense in action (http://www.youtube.com/watch?v=RSX3piF5ww8), what's the song playing at like 5:00 in?

On-topic, this thread contains awesomeness. Keep it up!
Logged
My voice acting portfolio.
Centration. Similar to Spacestation 13, but in 3D and first-person. Sounds damn awesome.
NanoTrasen Exploratory Team: SS13 in DF.

arclance

  • Bay Watcher
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #475 on: June 08, 2011, 11:03:44 pm »

Go to /usr/lib/jvm and look at the folder java-6-sun. Is it a shortcut?
Are there any other folders in /usr/lib/jvm?  If there are what are they called.

I am using Ubuntu 11.04 and my java-6-sun folder was a shortcut to another folder in the /usr/lib/jvm directory called java-6-sun-1.6.0.24.
I needed to specify the path /usr/lib/jvm/java-6-sun-1.6.0.24/jre/bin/java for Soundsense to work. 
I also copied the mp3 plugin (mp3plugin.jar) to /usr/lib/jvm/java-6-sun-1.6.0.24/jre/bin/ext.
I was able to get Soundsense working without changing soundSense.sh by uninstalling all other java programs except SunJava6. 
I was unable to get Ubuntu to respect the sudo update-alternatives --config java settings without doing this.
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

Thundercraft

  • Bay Watcher
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #476 on: June 09, 2011, 12:07:14 am »

I renamed the new file to match the one in the soundpack and replaced the soundpack file with it.
Soundsense was able to play the new file.
It looks like some of the files in the soundpack could be corrupted or have been altered by another program so that java can not play them...
I'm not sure if the following is related to this problem, but in December of last year I noticed a major bug in WinAmp's "in_vorbis.dll" plugin in their latest plug-in pack that sort of corrupted some of my .ogg music files. If I use WinAmp to change or add any file info (such as song title, artist, album, etc) to an .ogg file recorded using a variable bit rate algorithm, it seems to function as normal. However, the file size suddenly drops significantly (like from 2.7 Mb to 2.3 Mb). And the sound quality and bitrate is significantly worse. I'm guessing that the original .ogg files were recorded at a bitrate that the plug-in could not support, so it downsampled to whatever would work.

Of course, that's ridiculous - it's sloppy coding at best - because adding or altering file info at the beginning of a music file should not require the entire thing to be resampled to a worse quality! That's serious business! >:( I've posted about this and other issues I discovered with .ogg support on official support threads on the official Winamp forums, but my bug reports and issues have gone almost entirely ignored. In fact, the staff does not seem to post much on their own forums. (And I used to be a big fan of WinAmp, too... :( ) I'm beginning to think I should complain to the Xiph.Org Foundation, which maintains the .ogg standard. I could tell them that Winamp's plug-in is corrupting .ogg files, giving vorbis a bad rep, yet Winamp's team seems to be ignoring the issue.
« Last Edit: June 09, 2011, 12:21:05 am by Thundercraft »
Logged

zwei

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

Ah, perhaps you could have it so the balance code is normally disabled or bypassed and only enabled for sounds in the .xml file which have either randomBalance or balanceAdjustment applied to it?

It is supposed to do that (only display message when ss is supposed to be balancing accordign to xml but can not in order to notify author that some tweaking is needed), if it is not acting that way, it is bug on my side.

Have you installed a mp3 codec?  Linux does not come with one by default. 
If you have not installed one you can get this error because your OS has no way to play mp3 files.

That message relates to already decoded file and is about incompatible sound api of operating system. Also, mp3 decoding is handled completelly by SS, no extra plugings are needed.

...

Nice detective work :-)

I use mp3gain ( http://mp3gain.sourceforge.net/ ) to normalize volume. Supposdely, it should be lossless operation. Oh well...

Could you try using it on files you downloaded and see if it could be the cause of the problems?

arclance

  • Bay Watcher
    • View Profile
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #478 on: June 11, 2011, 03:30:32 pm »

...

Nice detective work :-)

I use mp3gain ( http://mp3gain.sourceforge.net/ ) to normalize volume. Supposdely, it should be lossless operation. Oh well...

Could you try using it on files you downloaded and see if it could be the cause of the problems?
mp3gain did not break the files running in linux (I havent tested mp3 gain in windows yet).

Edit: mp3gain running in windows did break the files for Soundsense running in linux.  md5 comparison of the output files shows that mp3gain produces different results in windows and linux. 
I found that mp3gain running in linux does not break the files if you want to use it.
« Last Edit: June 13, 2011, 10:53:06 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
Re: SoundSense: a sound engine for dwarf fortress.
« Reply #479 on: June 13, 2011, 07:54:15 pm »

This program isn't working for me. The application runs fine, auto-gets the soundpack fine, but no sounds play when I use it.

I just extracted it directly into my DF+ folder. The install instructions say it's expecting to be in a sub-folder, but they also say you can just extract it anywhere.

Should I move the stuff into a sub-folder or is this a bigger problem?
Logged
Pages: 1 ... 30 31 [32] 33 34 ... 105