Playing music in a vehicle - SLUniverse Forums
Navigation » SLUniverse Forums > Development Discussion and Support > Scripting » Playing music in a vehicle

Scripting Discuss scripting and programming for SL and other platforms

LinkBack Thread Tools Display Modes
Old 04-15-2018, 06:17 PM   #1 (permalink)
Not as dumb as I look
Rolig Loon's Avatar
More coffee, please
Join Date: Sep 2009
Location: In a TP
Posts: 357
SL Join Date: March 2007
Playing music in a vehicle

I know how to play a set of concatenated 10-second music clips as a continuous tune, and have done it successfully in the past. I have a client who wants to be able to play music in a vehicle, but I am discovering that the music's speed and pitch drop as the vehicle is moving -- almost like a Doppler effect. I didn't expect that, and don't see any way to prevent it. Is this a known issue, and is there any hope of getting around it?

My sound clips are all identical in length and each one is preloaded as the previous clip is being played. Standing still, the playback is fine -- no gaps, distortions, ....

EDIT: I am playing the sounds with llPlaySound. The problem disappears if I use llTriggerSound but, of course, the volume drops off rapidly as I move away from the spot where each sound was triggered, since the sound is not traveling with the vehicle in that case.
I'm awake ... I think.

Look for my scripted tools and my mesh items for the home and garden in SL's Marketplace at

Last edited by Rolig Loon; 04-15-2018 at 06:29 PM.
Rolig Loon is offline   Reply With Quote
Old 04-16-2018, 04:36 AM   #2 (permalink)
Thread Killer
Adeon Writer's Avatar
Join Date: Apr 2010
Posts: 10,561
SL Join Date: May 2007

Awards: 2
SLU Creepy Avatar Competition 2014 Participant 
There is no way to get rid of the Doppler effect via LSL, it is a Clintside option, you can disable it in sound settings, however.

If you are using llSetSoundQueueing(TRUE) the next clip should start immediately when the previous ends for them, even if it ends up being a few seconds too early/soon, that way if you queue up the next clip after the previous has been playing for 5 seconds, you have up to 5 second leeway for being too soon/late.

Also note that if you upload double speed .ogg’s instead of .wavs you can Have 20 second clips instead of 10. Oggs play at half speed when uploaded, so a 10 second ogg takes 20 seconds to finish. If you take a 20 second clip and speed it up to 10 seconds and then upload, SL plays it back normally.

Last edited by Adeon Writer; 04-16-2018 at 04:42 AM.
Adeon Writer is offline   Reply With Quote
2 Users Said Thanks :
Old 04-16-2018, 05:12 AM   #3 (permalink)
Senior Member
Sei Lisa's Avatar
My first name is Sei
Join Date: Aug 2013
Posts: 234
My Mood:
It's a client-side effect. There's a debug setting called AudioLevelDoppler to adjust it.

The Doppler effect should apply to the difference of velocities between emitter and receiver. It seems to apply to the velocity of the emitter only.

You can try filing a JIRA but there's little hope that it will be accepted. It was filed as VWR-10614 which was marked as duplicate of VWR-5775 and closed on the JIRA cleanup.
Tools for scripters that I'm the maintainer of:
LSL-PyOptimizer (NEW: Try it online!) | LSL Calculator | Unofficial LSL Reference Wiki | LSL Keywords Database
Sei Lisa is offline   Reply With Quote
1 User Said Thanks:
Old 04-16-2018, 09:37 AM   #4 (permalink)
Not as dumb as I look
Rolig Loon's Avatar
More coffee, please
Join Date: Sep 2009
Location: In a TP
Posts: 357
SL Join Date: March 2007
I was afraid of that. Thanks.
Rolig Loon is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On