Page 1 of 2

Sound File Names Chopped off

PostPosted: Fri Jul 11, 2008 2:07 pm
by andylegate
Once again I'd like to bring this up: the name of the wave files we put in Blender are being chopped off.

Is there anything that we can do about this? Especially as one of the requirements will be adding things like a 4 letter name to all Fan Age files to make sure they are unique.

Most of the names that Cyan uses for their sound files are rather long, so this is also a problem in that, even though they said we could use those files (point to them) I CAN'T because Blender keeps chopping the darn names off after 11 or 12 characters.

Re: Sound File Names Chopped off

PostPosted: Fri Jul 11, 2008 4:29 pm
by Chacal
Yes Blender does that to object names too. When I mentioned this months ago the devs said nothing could be done since it was a Blender problem. I can't understand with the Blender devs would have done such a weird thing.

Re: Sound File Names Chopped off

PostPosted: Fri Jul 11, 2008 4:42 pm
by Aloys
Chacal wrote:I can't understand with the Blender devs would have done such a weird thing.

That's a reaction I have with many aspects of Blender :D

Re: Sound File Names Chopped off

PostPosted: Fri Jul 11, 2008 5:43 pm
by Grogyan
Thats a limitation of Blender.

Try submitting it as a bug to the Blender Dev team to have them alter the length for future versions

Re: Sound File Names Chopped off

PostPosted: Sat Jul 12, 2008 5:41 am
by D'Lanor
As a workaround, does using the short DOS name work? Windows still keeps a record of those. So if you wanted to play xJourneyClothGlow.ogg you could reference it as XJOURN~1.OGG.

That naming method has its disadvantages since there are files with overlap in their first 8 characters. For example xWaterfall_LongDist_Loop.ogg, xWaterfall_Medium_Loop02.ogg and xWaterfall_MediumDist_Loop.ogg on my system have short names XWATER~1.OGG, XWATER~3.OGG and XWATER~2.OGG respectively. The number is assigned in order of file creation and may be different on different computers.

Re: Sound File Names Chopped off

PostPosted: Sat Jul 12, 2008 9:54 am
by Robert The Rebuilder
Back when I received word from Cyan that we can use their sounds in our ages, I was wondering how to fix this problem (since their sound file names are so darned long). I thought of the following potential solution.

Since the name of the sound file is not limited by the AlcScript but instead by Blender's sound objects, we should allow the case where no Blender sound object exists but the .OGG file is in the same directory as the Blender file.

If plWin32Sound.exportObj() does not find a Blender sound object, it then attempts to open the .OGG file. Using code converted to Python from the open-source Audacity tool, we can read the sound data and other plWAVHeader info from the OGG file, stick it into the plSoundBuffer, and continue.

I never got around to doing this, and I don't think I will anytime soon. So, anyone willing to look at Audacity's source code is more than welcome to implement this solution.

[EDIT] Here's a link to the Audacity source:

http://audacity.sourceforge.net/download/source

Re: Sound File Names Chopped off

PostPosted: Wed Aug 06, 2008 9:45 am
by Robert The Rebuilder
I finally found the time to tackle this. I modified prp_SndClasses.py so that it supports WAV and OGG files with any length of file name. Now, you no longer need to load the sound file into Blender in order to export. I tested this on external WAV and OGG files, and on the URU OGG file bhroYeesha_TldnSpeech_eng.ogg - I had Yeesha's voice booming at me when I entered my test age!

I checked it into the contrib folder. The changes are based on the latest revision (312). Would one of the PyPRP developers please merge this in?

http://svn.guildofwriters.com/pyprp/con ... Classes.py

Once the 1.5.1 release comes out, I'll update the sound tutorials accordingly. Now we can finally use Cyan's sound files in our ages!

Re: Sound File Names Chopped off

PostPosted: Wed Aug 06, 2008 10:26 am
by Nadnerb
Committed to 1.5.1 and trunk. Very nice. :)

Re: Sound File Names Chopped off

PostPosted: Wed Aug 06, 2008 11:27 am
by andylegate
oh thank you thank you thank you thank you thank you thank you thank you!!!

You made me so happy that I almost have tears in my eyes!!!! :D

Re: Sound File Names Chopped off

PostPosted: Wed Aug 06, 2008 11:29 am
by boblishman
Robert this is GREAT news ...thank you ...

now, .... I just have v.1.5.0.

....can I download this and just drop it into my scripts folder ... and it will work?