LouiZeForum
Would you like to react to this message? Create an account in a few clicks or log in to continue.
LouiZeForum

3D vrml
 
HomeHome  SearchSearch  Latest imagesLatest images  RegisterRegister  Log in  3Dchats / forums3Dchats / forums  
Le Deal du moment : -38%
Enceinte colonne – Focal Chorus 726 – Noir ...
Voir le deal
245 €

 

 sound

Go down 
3 posters
AuthorMessage
alain
fondateur
fondateur
alain


Number of posts : 23529
Localisation : Dompierre sur Veyle ,France
Registration date : 2005-04-19

sound Empty
PostSubject: sound   sound EmptyWed 22 Jul - 19:45

is it true that a mp3 begins to play at any moment ,
when entering a world ?

( I mean , not only at the begginning of the song )

I use that now , is there a better way ?


Code:
Shape {
appearance   Appearance {
material   Material {
diffuseColor .06 .06 .06   }
texture DEF sound MovieTexture 
{url "rutebeuf.mp3" startTime -1 loop FALSE  }  }
geometry   Box { size .001 001 001}}       
DEF    vis VisibilitySensor { size 1000 1000 1000}
ROUTE vis.isActive TO sound.loop
ROUTE vis.enterTime   TO sound.startTime
Back to top Go down
peter le cochon
+1000
+1000
peter le cochon


Number of posts : 1032
Localisation : deutschland (sniff)
Registration date : 2005-05-28

sound Empty
PostSubject: Re: sound   sound EmptyWed 22 Jul - 21:57

Hi, how are your holidays going?

MovieTexture (the standard node) has got an event out that might help you :

eventOut SFTime duration_changed

This event-out is fired by the movie-texture each time the media has been loaded.

Example :



Code:
#VRML V2.0 utf8
Shape {
   appearance  Appearance {
      material  Material {
         
         diffuseColor .06 .06 .06
      }
      texture DEF sound MovieTexture{
         
         url "rutebeuf.mp3" startTime -1 loop FALSE
      }
   }
      geometry  Box { size .001 001 001}
}

DEF S Script {

   eventIn   SFTime media_loaded
   eventOut SFTime   launch_media

   url   "javascript:
   
   
   function media_loaded(_data,t){
   
      launch_media=t;
   
   
   }
   
   
   "

}     
ROUTE sound.duration_changed TO S.media_loaded

Well, I guess it should help to start the media when it's loaded.

TC

pig
Back to top Go down
alain
fondateur
fondateur
alain


Number of posts : 23529
Localisation : Dompierre sur Veyle ,France
Registration date : 2005-04-19

sound Empty
PostSubject: Re: sound   sound EmptyWed 22 Jul - 22:30

OK thanks ,
I arranged it LOL with

.0001 .0001 .0001 Smile

Code:
Shape {
appearance  Appearance {
material  Material {
diffuseColor .06 .06 .06}
texture DEF sound MovieTexture{
url "rutebeuf.mp3" startTime -1 loop FALSE}}
geometry  Box { size .0001 .0001 .0001}}
DEF S Script {
eventIn  SFTime media_loaded
eventOut SFTime  launch_media
url  "javascript:
function media_loaded(_data,t){
      launch_media=t;
  }
  "
}     
ROUTE sound.duration_changed TO S.media_loaded

and adding :
ROUTE S.launch_media TO sound.startTime


but how you get it loop ?

btw it begins at the beginning LOL , thanx


my holidays ?


guys must be asked in december 1995 to keep my dog ,
( chenil )

and as I asked today to have Choupi kept 2 days to being free for a short 2 days trip with Bertrand ,
they told me

" we have no place for your dog until august 20" !! LOOL

so I will stay a slave on 3DSmax Smile)


( until it works , it is a trial LOl Sad((
Back to top Go down
peter le cochon
+1000
+1000
peter le cochon


Number of posts : 1032
Localisation : deutschland (sniff)
Registration date : 2005-05-28

sound Empty
PostSubject: Re: sound   sound EmptyThu 23 Jul - 0:15

scratch ... Shocked ... oups ... yes

Here is a working example :

It starts looping once the media file has been loaded, never mind if the shape is being rendered or not.

You don't need to give it a material, neither you need to give it a visible size ( 0 0 0 will be OK).

I have added a NavigationInfo, so BS-Contact (bleurk!!!) does not start in "EXAMINE" mode, and I have added a Viewpoint, backing the shape, so you don't render it at start-up.

The problem was in the startTime and stopTime ...

Code:

#VRML V2.0 utf8

NavigationInfo {

   type ["FLY","ANY"]

}

Viewpoint {

   position 0 0 -100

}

Shape {

   appearance  Appearance {

      texture DEF sound MovieTexture{
         url "rutebeuf.mp3"

          loop FALSE
      }
   }

   geometry Box {size 0 0 0}
}

DEF S Script {

   eventIn  SFTime media_loaded
   eventOut SFTime  launch_media
                eventOut SFBool set_loop
   url  "javascript:

      function media_loaded(_data,t){
          launch_media=t;
                                    set_loop=true;
      }
   "
}     
ROUTE sound.duration_changed TO S.media_loaded
ROUTE S.launch_media TO   sound.startTime
ROUTE S.set_loop TO sound.loop

TC pig
Back to top Go down
alain
fondateur
fondateur
alain


Number of posts : 23529
Localisation : Dompierre sur Veyle ,France
Registration date : 2005-04-19

sound Empty
PostSubject: Re: sound   sound EmptyThu 23 Jul - 1:09

merci dear , Peter : )

btw I found by hazard a song from Léo Ferré , I adore , and Joan Baez perform here .
I had put it in what I was playing with to day , a sketch ,

http://mixed3d.free.fr/alain/maps/galerielightmapsportejourptr.wrl

Btw it took me 1/2 second to get that rutebeuf.mp3 LOL Smile

and it begins at the beginning ,

but where is a loop ?


argg

moment

I reedit too soon LOL


- sorry to bore you Smile
Back to top Go down
peter le cochon
+1000
+1000
peter le cochon


Number of posts : 1032
Localisation : deutschland (sniff)
Registration date : 2005-05-28

sound Empty
PostSubject: Re: sound   sound EmptyThu 23 Jul - 1:18

Confused ... sorry, my fault.

I did not expect you being awake so late, so I have been editing and re-editing the code ...

Just try the code of my previous post again. I have recently added a new eventOut to the script (set_loop) ... it sets loop TRUE.

Desoleé Rolling Eyes

Laughing pig
Back to top Go down
alain
fondateur
fondateur
alain


Number of posts : 23529
Localisation : Dompierre sur Veyle ,France
Registration date : 2005-04-19

sound Empty
PostSubject: Re: sound   sound EmptyThu 23 Jul - 1:24

very OK Smile

http://mixed3d.free.fr/alain/maps/galerielightmapsportejourptrok.wrl

thanks Smile



some years ago I had an ancient pupil who was playing on LouiZe

One time she invited us to that sort of game :

one had to upload on the forum one photo he took , in less than 1 minute , etc

We have to do that with coding LOL


( I was supposed to watch "Big Fish" of Tim Burton ,
with Bertrand ,
on a CD ,
but I am not patient to sit on a chair , LOL ,
....
he is mad at me Smile

btw it is an excellent movie Smile
Back to top Go down
peter le cochon
+1000
+1000
peter le cochon


Number of posts : 1032
Localisation : deutschland (sniff)
Registration date : 2005-05-28

sound Empty
PostSubject: Re: sound   sound EmptyThu 23 Jul - 1:36

Last question for today :

Why does Joan Baez speak french more like Edit Piaff than like Colin McKinlay?

Last recomendation for today :

Take "Choupy" ... or however your killer-dog (le chien assasin) is called ... with you, to wherever you go for holidays.

Enjoy.

pig
Back to top Go down
alain
fondateur
fondateur
alain


Number of posts : 23529
Localisation : Dompierre sur Veyle ,France
Registration date : 2005-04-19

sound Empty
PostSubject: Re: sound   sound EmptyThu 23 Jul - 1:48

I dont remember why I jumped on that today