Sound nodes...

 
Post new topic   Reply to topic    VRMLWorld.net Forum Index -> ABNet2::Blogs
View previous topic :: View next topic  
Author Message
Laz
Forum Junkie


Joined: 15 May 2003
Posts: 91
Location: upper midwest

PostPosted: Mon Mar 16, 2009 9:45 am    Post subject: Sound nodes...

LOL. I was racking my brain last night trying to play an mp3 file and i wasnt getting any sound. I was baffled to say the least. Just this morning it dawned on me that mp3's have to be treated differently in vrml because of specific browser support. It saddens me to know that contact still hasn't built in support for these in the audioclip node. It would be nice to have the spatialized sound from an mp3.

Anyways, I am sure most of you already know this but i will post my results anyways for those that do not.

in this first examp[le is a normal sound node:



Sound {
source DEF honkyAudioClip {
pitch 1
loop FALSE
url"horn1.mp3"
}
minFront 0 maxFront 100
minBack 0 maxBack 100
spatialize TRUE
intensity 1
location 0 1.75 0
direction 0 0 1
}


All is good here except the mp3 wont emit sound in contact.

in the next example is how you get an mp3 to make sound:

Shape {
appearance Appearance {
material Material {
diffuseColor 1 1 1
}
texture DEF honky MovieTexture {
startTime -1
stopTime 0
loop FALSE
url "horn1.mp3"
}
}
geometry Box {
size 0.005 0.005 0.005
}
}


Although you can hide the geometry by making it very very small or by using a full transparency in a material node, I don't like this because the sound can be heard throughout the entire world like you are wearing headphones aropund with you. This can be useful for a few things that don't require spatialization bout for truly good sound effects, wave files are still the way to go i guess. Now i guess i need to get into my nero wave editor and reduce the file sizes of the wave files i intend to use in my world so they aren't so bulky.

It really is a shame that there isb't support for mp3 in contact. mp3's are much smaller file size and would be a perfect fit for a VRML environment. Oh well, I guess it's just another thing to work around. lol


Laughing

Laz~
Back to top
vcard
Forum Junkie


Joined: 01 Aug 2008
Posts: 58

PostPosted: Wed Mar 18, 2009 6:23 pm    Post subject:

Had that problem once, but it does not affect all users. Some will ear the sound and others wont. It seems that you are on the "others" side. Others could even crash the browser if the file is read from a web server Exclamation

Idea The problem is with the 2 channel sound (stereo) normally present in mp3 files. If changed to "mono", the mp3 should work well in a normal sound node. In my case worked.

vcard
Back to top
Laz
Forum Junkie


Joined: 15 May 2003
Posts: 91
Location: upper midwest

PostPosted: Wed Mar 18, 2009 9:30 pm    Post subject: thanks

Ok i will try that. i'll edit some mp3 into mono and see if that works. Do you still get the spatialized sound from mono? can you at least here that it's coming from a particular direction or just everywhere?

ther wierd thing is though that i converted exsisting wave files to mp3. waves dont normally have 2 channel do they? or perhaps my nero wave editor converts to 2 channel by default. i'll have to look into that. thank you for the response Smile
Back to top
Laz
Forum Junkie


Joined: 15 May 2003
Posts: 91
Location: upper midwest

PostPosted: Wed Mar 18, 2009 9:58 pm    Post subject: ;)

I did as you suggested and it seems there is a very easy way to convert that with nero recode. I changed it to mono and set it on a quality setting of 6, which on a scale of 1-10 is slightly less than half quality, 1 being the best. I was able to lower the file size by 25% and i cannot not notice any quality loss from the wave i was using. Nero recode is what is needed. the wave editor only saves in stero by default.

WhoopY! thanks VC.

Now the other problem is that you mentioned some people might crash from trying to open an mp3 in a sound node? I don't want to be responsible for causing crashes... Sad

So for the sake of compatibility do you suggest not using them then?
Back to top
vcard
Forum Junkie


Joined: 01 Aug 2008
Posts: 58

PostPosted: Thu Mar 19, 2009 7:26 pm    Post subject:

Glad it works Smile

I use mp3 in VRML/x3D.

Only heard about "some" crashes with mp3 stereo files inside worlds, but very few cases. The problem seems to disappear when the files are changed to mono. So, as far as I know, you don't have to worry now Smile

The golden rule seems to be "mp3 sound, yes! But mono files only".

vcard
Back to top
Russ Kinter
Forum Junkie


Joined: 15 May 2003
Posts: 11
Location: Harrisburg, Pa

PostPosted: Sun May 16, 2010 6:24 pm    Post subject: Playing spatialized MP3 with Contact

Actually I think (am 95% sure this works) you can get spatialize to work here is how using your example code:

# You simply put the MovieTexture above the Sound Node instance on the
# scene graph
Shape {
appearance Appearance {
material Material {
diffuseColor 1 1 1
}
texture DEF honky MovieTexture {
startTime -1
stopTime 0
loop FALSE
url "horn1.mp3"
}
}
geometry Box {
size 0.005 0.005 0.005
}
}

# And USE it below in the Sound Node
Sound {
source USE honky
minFront 0 maxFront 100
minBack 0 maxBack 100
spatialize TRUE
intensity 1
location 0 1.75 0
direction 0 0 1
}
Back to top
Laz
Forum Junkie


Joined: 15 May 2003
Posts: 91
Location: upper midwest

PostPosted: Wed May 19, 2010 4:23 pm    Post subject: Spatialize

I gave this try but it was a static sound on my machine. no spatialization.

This is kind of an old thread but I have tried several combinations with sound and thoiugh I personally have always been able to here an MP3 in just a sound node, others have not been able to. I have been trying to use wave files as much as possible so as to not leave anyone out. VC has said that mp3 are very tweaky on some peop-lke's system though I wish a solution could be found as mp3 is much smaller for download purposes.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VRMLWorld.net Forum Index -> ABNet2::Blogs All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum