Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006879opensim[REGION] Script Functionspublic2013-12-03 13:182014-09-30 09:13
ReporterErnst Uxlay 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformPC Win32NT, 32-bitOSMS VistaOS VersionSP2
Product Versionmaster (dev code) 
Target VersionFixed in Version 
Summary0006879: sound does not play
DescriptionI am italian so please forgive me a poor english.
Running Diva distro on a PC with Vista I found a problem with sound.
Theese lines from my log:
--------------------
2013-12-01 16:54:19,198 INFO - OpenSim.Framework.Servers.ServerBase [SERVER BASE]: OpenSimulator version: OpenSim 0.7.6 Release
2013-12-01 16:54:19,203 INFO - OpenSim.Framework.Servers.ServerBase [SERVER BASE]: Operating system version: Microsoft Windows NT 6.0.6002 Service Pack 2, .NET platform Win32NT, 32-bit
--------------------
My goal is to play sound from an item worn by the avatar.
Since I received no sound executing my script I tried to modify it, searched in web for help in Opensim doc but nothing available about sound (http://opensimulator.org/wiki/Sound_Protocol [^]).
I tried with Firestorm and with Singularity viewers with same results.
I tried in SecondLife and there it worked as expected so I decided to report what happens to you.
This is my actual script:
// //////////////////////////////
// soundtest
// //////////////////////////////
string sound;
DoSound(){
    // llPlaySound("sound ",1.0);
    // llSound("sound",1.0,FALSE,FALSE); // deprecated
    llTriggerSound(sound, 1.0);
    llOwnerSay("sound " + sound);
}

default
{
    state_entry()
    {
        integer count = llGetInventoryNumber(INVENTORY_SOUND);
        llOwnerSay("count = " + (string)count);
        count = count -1;
        sound = llGetInventoryName(INVENTORY_SOUND, count);
        llOwnerSay((string)count + " - " + sound);
        llPreloadSound(sound);
    }
    
    touch_end(integer num_detected)
    {
        DoSound();
    }
}

As you can see the script is simple, an object contains the script and a sound (I did so to change sound file easily to be sure the problem was not in the sound file) and on touch it must play the sound.
During my tests only once it happened to hear the sound, but moving the camera the sound disappeared and didn't play again.
Another thing I noticed about sound files is that if I double click on a sound from inventory... "Play Locally" works but "Play Inworld" works not.
Thanks for your great work.
I hope in future to give some help.
Steps To Reproduce1) create an item
2) put a sound inside the item
3) put inside the item the script I wrote in "description"
4) touch the item (only once it happened to me to hear the sound, but moving the camera the sound disappeared and didn't play again)
Additional InformationThe same script in SecondLife works when object is on the ground or attached.
I made tests at office and at home with same results.
I am uploading too the script as I reported in description section.
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (Multiple Regions per Sim)
Physics EngineBasicPhysics
Script Engine
Environment.NET / Windows32
Mono VersionNone
ViewerFirestorm and Singularity
Attached Files? file icon soundtest.lsl [^] (707 bytes) 2013-12-03 13:18

- Relationships

-  Notes
(0024812)
Ernst Uxlay (reporter)
2013-12-05 04:41

News about this issue:
I was testing in a 4 region scenario, where I have home in region 1, and I was not in region 1.
This is the new test unit:
// //////////////////////////////
// soundtest3
// //////////////////////////////
string sound;

DoSound(){
    // llPlaySound("sound ",1.0);
    // llSound("sound",1.0,FALSE,FALSE); // deprecated
    llTriggerSound(sound, 1.0);
    llOwnerSay("sound " + sound);
}

default
{
    state_entry()
    {
        integer count = llGetInventoryNumber(INVENTORY_SOUND);
        llOwnerSay("count = " + (string)count);
        count = count -1;
        sound = llGetInventoryName(INVENTORY_SOUND, count);
        llOwnerSay((string)count + " - " + sound);
        llPreloadSound(sound);
        llSetTimerEvent(5);
    }
    timer()
    {
        DoSound();
    }
}

Now...
If I go to my home region, crossing border or doing ctrl+shift+H, the script begin to work.
If I walk out of region 1 the script stops working.
If I return to home region the script restart working.
(0026570)
azwaldo (reporter)
2014-07-24 10:20

Additional info; behavior varies among event handlers.

Tested this fxn within various event handlers, adding llOwnerSay report to Chat History to confirm firing of each event (script included below).

OpenSim 0.8.1 Dev 36920ad: 2014-07-21 23:58:30 +0100 (Unix/Mono)

llPlaySound fxn DID WORK as expected from within these handlers:
state_entry
touch_start
listen
changed
collision_start

llPlaySound fxn DOES NOT WORK as expected when called from these handlers:
on_rez
attach*

The llPlaySound() function was tested repeatedly from within each event handler. In every case, the event in question DID fire (llOwnerSay msg was written to Chat History as expected), and on one occasion the sound file DID play from within the "attach" handler; however, many repeated attempts with "attach" handler failed to produce the sound.

//////////////////////////////////////
// llPlaySound (on_rez) test script///
//////////////////////////////////////
string sound;
default
{
    state_entry()
    {
        sound = llGetInventoryName(INVENTORY_SOUND, 0);
        if (sound) {
            llOwnerSay("sound in Inventory: " + sound);
        } else {
            llOwnerSay(">> NO sound found in Inventory <<");
        }
        //llPlaySound(sound, 0.6);//UN-COMMENT to confirm function
        llOwnerSay("EVENT FIRED: state_entry");
    }
    on_rez(integer start_param) {
        llPlaySound(sound, 0.6);
        llOwnerSay("EVENT FIRED: on_rez");
    }
    touch_start(integer total_number)
    {
        //llPlaySound(sound, 0.6);//UN-COMMENT to confirm function
        llOwnerSay("EVENT FIRED: touch_start");
    }
    collision_start(integer num)
    {
        llPlaySound(sound, 0.6);
        llOwnerSay("EVENT FIRED: collision_start");
    }
    attach(key id)
    {
        if (id) // is a valid key and not NULL_KEY
        {
            llPlaySound(sound, 0.6);
            llOwnerSay("EVENT FIRED: attach <id param NOT NULL>");
        }
        else
        {
            llPlaySound(sound, 0.6);
            llOwnerSay("EVENT FIRED: attach <id param: " + (string)id + ">");
        }
    }
}
(0026868)
azwaldo (reporter)
2014-09-30 09:13

Adding this to modify my previous note (2014-07-24):

llPlaySound fxn DOES NOT WORK as expected when called from "state_entry" event handler *IF* that handler is in a state called from within an "on_rez" event handler.

1. Place llPlaySound fxn in state_entry for "state TEST"
2. Call state TEST from default state's "on_rez" event handler
...fxn does not work

- Issue History
Date Modified Username Field Change
2013-12-03 13:18 Ernst Uxlay New Issue
2013-12-03 13:18 Ernst Uxlay File Added: soundtest.lsl
2013-12-05 04:41 Ernst Uxlay Note Added: 0024812
2014-07-24 10:20 azwaldo Note Added: 0026570
2014-09-30 09:13 azwaldo Note Added: 0026868


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker