View unanswered posts | View active topics
| Author |
Message |
|
1drey
|
Post subject: Any possibility to add background sound? Posted: Sun Mar 22, 2009 7:37 pm |
|
 |
| Photographer |
Joined: Sat Nov 05, 2005 9:58 pm Posts: 47
|
...and a sound tied to the hotspot?
Just want to make a small demo project, where sound should play important role. Have to decide if it sould be implemented with devalvr or some flash based viewer...
With devalvr i can't add sound, with flash - can't pack the tour into exe 
_________________ "There are certain things that humans are not permitted to know -like what we are doing."
William Burroughs
|
|
| Top |
|
 |
|
fiero
|
Post subject: Posted: Mon Mar 23, 2009 5:06 pm |
|
 |
| I only was walking somewhere... |
 |
Joined: Tue Aug 09, 2005 1:55 am Posts: 2007
|
Hi 1drey,
I'm testing some basic functions in latest version to play sound. You can download latest version and test it http://www.devalvr.com/descargas/dps/playerUnicode.zip
You can define a sound in the script this way:
Code: (song1) { type=SOUND; file=music.mp3; } Then, you can use some new functions to play this sound file. These are the new functions: PlaySound(objectName, loop); StopSound(objectName); PauseSound(objectName); ResumeSound(objectName); VolumeSound(objectName, value, channel); You can define these functions in the "code" parameter of any BUTTON, NODO, of any other instruction. For example, if you want to start a background sound in the first panorama, you can define a timer (for example 0.5 seconds) and run the PlaySound() function: Code: (pano) { type=MOV; file=panorama.mov; settimer=timer1, 1, 0.5, "PlaySound("song1",1);"; }
(song1) { type=SOUND; file=music.mp3; }
The second parameter of PlaySound function must be 0 or 1, if it's 1 the the sound is repeated indefinitely when it finishes.
To change the volume, you can use a percentage value from 0 to 100. For example:
VolumeSound("song1",50);
You can change the volume of only one channel, left or right, for example, to change the right channel to 50%:
VolumeSound("song1",50,"right");
regards!
|
|
| Top |
|
 |
|
DvJariKy
|
Post subject: Posted: Tue Mar 24, 2009 9:21 am |
|
Joined: Mon Mar 16, 2009 3:17 pm Posts: 12
|
|
This is great, I'm going to try this in a sec as well.
And if you don't mind additional wishes... assuming that in this first version the sound will abruptly end when moving to next panorama, I'd like to suggest an option for a smooth "fade out" sound effect, triggered either by a scene change or a dedicated new sound function.
Thanks!
EDIT:
I downloaded the file you linked (version 0,7,6,0), but I can't hear the sound in my panorama... it plays fine in Windows Media Player, for example. Here's some code I'm using:
The sound: (MusicMountain) { Type = Sound; File = 04.MP3; }
The timer: SetTimer = MusicTimer , 1 , 2 , "PlaySound("MusicMountain",1);";
|
|
| Top |
|
 |
|
fiero
|
Post subject: Posted: Tue Mar 24, 2009 10:19 am |
|
 |
| I only was walking somewhere... |
 |
Joined: Tue Aug 09, 2005 1:55 am Posts: 2007
|
|
Hi DvJariKy,
Can you test with PlaySound("MusicMountain",0); ? I see that some files does not work correctly with the loop option. Maybe I must think another way to do the loops.
The sound is independent of the panoramas, the sound does not stop in a scene change. I think this behavior is better to create a background for all the virtual tour without interferences (if needed). Anyway you can stop or play a sound when you use GoToFrame function.
Yes, it's a good idea to create a Fade in/out function.
regards!
|
|
| Top |
|
 |
|
DvJariKy
|
Post subject: Posted: Tue Mar 24, 2009 10:30 am |
|
Joined: Mon Mar 16, 2009 3:17 pm Posts: 12
|
|
Hi Fiero,
Unfortunately the change to the loop-setting didn't fix the problem. I wish I could also help solving this, but I'm out of ideas at the moment.
EDIT:
I don't know if this helps anything but with both "0" and "1" in the loop-setting, the loading bar stops after two seconds (my timer is set to that), then the loading apparently finished normally after a few seconds and the panorama is shown, but without the sound. If the timer is set to e.g. 35 seconds, which longer than what the loading takes, the loading bar will get to finish without interruption, but the sound still won't be heard even if I wait another 35 seconds. But this probably won't help solving this problem.
Also, I tried with a few other Mp3-files, but no luck yet.
|
|
| Top |
|
 |
|
1drey
|
Post subject: Posted: Tue Mar 24, 2009 11:03 am |
|
 |
| Photographer |
Joined: Sat Nov 05, 2005 9:58 pm Posts: 47
|
Great extention of functionality!
Good job!
Will test it with my projects.
_________________ "There are certain things that humans are not permitted to know -like what we are doing."
William Burroughs
|
|
| Top |
|
 |
|
fiero
|
Post subject: Posted: Tue Mar 24, 2009 11:45 am |
|
 |
| I only was walking somewhere... |
 |
Joined: Tue Aug 09, 2005 1:55 am Posts: 2007
|
|
DvJariKy,
If you see a small stop after two seconds, this means that the sound is loaded. But it exist any problem with playing. I can add an error message to see what is the problem. What about WAV files?
|
|
| Top |
|
 |
|
DvJariKy
|
Post subject: Posted: Tue Mar 24, 2009 2:36 pm |
|
Joined: Mon Mar 16, 2009 3:17 pm Posts: 12
|
|
Wav-files do the same - the loading seems to pause (even though it does continue) and the panorama loads normally but plays no sound. Maybe the sound works for others though, let's wait for more reports.
But the error messages would be great, if they can pinpoint the problem.
|
|
| Top |
|
 |
|
fiero
|
Post subject: Posted: Wed Mar 25, 2009 12:00 pm |
|
 |
| I only was walking somewhere... |
 |
Joined: Tue Aug 09, 2005 1:55 am Posts: 2007
|
|
| Top |
|
 |
|
emilban
|
Post subject: Posted: Wed Mar 25, 2009 2:18 pm |
|
Joined: Tue Jul 03, 2007 2:51 pm Posts: 103 Location: Germany
|
|
Hi fiero,
My first test with the betaversion:
mp3 ...the player froze in!
wav. .. show error: unknown command parameter (Unbekante Befehlsparameter in German)
|
|
| Top |
|
 |
|
fiero
|
Post subject: Posted: Wed Mar 25, 2009 6:33 pm |
|
 |
| I only was walking somewhere... |
 |
Joined: Tue Aug 09, 2005 1:55 am Posts: 2007
|
|
Hi emilban,
I think the problem with wav is that you used the loop parameter. Maybe it will work if you use 0. For mp3 this will be more complicated, because this use the codec installed in the system. Maybe it's better to use wav files for compatibility, at least until I find to play mp3 without external dependences.
regards!
|
|
| Top |
|
 |
|
DvJariKy
|
Post subject: Posted: Wed Mar 25, 2009 7:03 pm |
|
Joined: Mon Mar 16, 2009 3:17 pm Posts: 12
|
Fiero,
I'm not sure if you changed something, or if I did, but with the last version you uploaded, I got the background sound/music working... looping works too. I didn't test wav-files yet, but I suppose they would work too. Good job!
Now the only problem I have left is to figure out the best way to play different background sounds/music in different scenes.  Like you said before, I may have to use StopSound-function to stop the current one, and then start and new one... unless there's a way to make the StopSound-function affect all sounds that are currently being played, that might simplify things for me a bit. Or alternatively, are you planning to add an instruction for scene-specific background sounds soon, similar to the Rot and Zoom-instructions?
Cheers!
|
|
| Top |
|
 |
|
emilban
|
Post subject: Posted: Wed Mar 25, 2009 8:44 pm |
|
Joined: Tue Jul 03, 2007 2:51 pm Posts: 103 Location: Germany
|
Hi,
wav. works with command: PlaySound("song1") .
I'm waiting also for the mp3 solution. It's better like wav 
|
|
| Top |
|
 |
|
fiero
|
Post subject: Posted: Wed Apr 08, 2009 1:05 am |
|
 |
| I only was walking somewhere... |
 |
Joined: Tue Aug 09, 2005 1:55 am Posts: 2007
|
DvJariKy wrote: Now the only problem I have left is to figure out the best way to play different background sounds/music in different scenes.  Like you said before, I may have to use StopSound-function to stop the current one, and then start and new one... unless there's a way to make the StopSound-function affect all sounds that are currently being played, that might simplify things for me a bit. Or alternatively, are you planning to add an instruction for scene-specific background sounds soon, similar to the Rot and Zoom-instructions?
Hi DvJariKy,
Sorry my delay, but I'm a newbie with sounds  . Internally in the player I used the system functions to play sounds. It appears that the word "all" works with all opened channels. I tested it with StopSound function and it works, maybe you can use it to stop all sounds and start a new sound in every scene:
SetTimer=MusicTimer , 1 , 1.0 , "StopSound("all");PlaySound("MusicMountain",1);";
regards!
|
|
| Top |
|
 |
|
DvJariKy
|
Post subject: Posted: Wed Apr 08, 2009 11:10 am |
|
Joined: Mon Mar 16, 2009 3:17 pm Posts: 12
|
Hi Fiero,
No problem, take your time. Your suggestion sounds good and should do the trick nicely. And looks like it will work without an update as well, so I guess I'll go update the code now.
Thanks!
|
|
| Top |
|
 |
Who is online |
Users browsing this forum: No registered users and 0 guests |
|
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 post attachments in this forum
|

|