Author Topic: Sound Manager  (Read 1432 times)

AryHann

  • Veteran
  • *
  • Posts: 1244
  • WonderWoman
    • View Profile
Sound Manager
« on: March 02, 2005, 11:18:51 am »
Hi!

I want to ask something on how the sound management works.

I have found the XML files in the map files (sound.xml) and they seem to have the information on \"which music to play\" depending from sector to sector.

1)How this line works, though?
(associated to a mesh?)

Is it like considering the mesh an emitter of sound and have the sound always there, if you are in a certain range?
Or something else?

In any case, is there something special to consider when deciding that a mesh is \"a sound emitter\"?
(because, I have tried something but I get a crash at this line csRef move = mesh->GetMovable();  in pssoundmng)

This is the BT of that crash:
>   pssound.dll!psSectorSoundManager::Enter(psSectorSoundManager * leaveFrom=0x00000000, int timeOfDay=1, int weather=1, csVector3 & position={...})  Line 1318 + 0xe   C++
     pssound.dll!psSoundManager::EnterSector(csString & sectorName={...}, int timeOfDay=1, int weather=1, csVector3 & position={...})  Line 693  C++
     psclient.exe!ModeHandler::SetSectorMusic(const char * sectorname=0x08bffcf8)  Line 368  C++
     psclient.exe!ModeHandler::HandleNewSectorMessage(MsgEntry * me=0x04c39248)  Line 359    C++
     psclient.exe!ModeHandler::HandleMessage(MsgEntry * me=0x04c39248)  Line 235 C++
     psclient.exe!psClientNetSubscriber::HandleMessage(MsgEntry * msg=0x04c39248, Client * __formal=0x0012fd30)  Line 72 + 0x16  C++
     psclient.exe!MsgHandler::Publish(MsgEntry * me=0x04c39248)  Line 98 C++
     psclient.exe!psClientDR::CheckSectorCrossing(iPcLinearMovement * linmove=0x08bcf310)  Line 153  C++
     psclient.exe!psEngine::UpdatePerFrame()  Line 802   C++
     psclient.exe!psEngine::HandleEvent(iEvent & ev={...})  Line 731 C++
     psclient.exe!psEngine::EventHandler::HandleEvent(iEvent & ev={...})  Line 209   C++
     psclient.exe!csEventQueue::Notify(unsigned int pseudo_event=10)  Line 220   C++
     psclient.exe!csEventQueue::Process()  Line 237  C++
     psclient.exe!csDefaultRunLoop(iObjectRegistry * r=0x00b166b8)  Line 82  C++
     psclient.exe!main(int argc=1, char * * argv=0x00b14ca0)  Line 1881 + 0x9    C++
     psclient.exe!mainCRTStartup()  Line 398 + 0x11  C
   KERNEL32.DLL!7c59893d()    


2) I have seen that now, while loading the client, it can finds the sound.xml for a sector, but not the   Could not find file: /planeshift/world/landscape_cleanedsound.xml
How should this be created?

3) Which should be the difference between \"background music\" and \"ambient music\" ?

4) uhm, it seems that when I close the window (minimize) the sounds go away, but when I maximize it I cannot get the sound running again?

Thanks,
Ary
« Last Edit: March 02, 2005, 02:16:31 pm by AryHann »
AryHann

http://www.reflex.lth.se/culture/annelov - Virtual Annelöv -
Engine Dep. - One of Talad's Angels - Aka ww & Ahrijani's Goddess

GeorgeD

  • Hydlaa Resident
  • *
  • Posts: 93
    • View Profile
(No subject)
« Reply #1 on: March 06, 2005, 03:55:29 pm »
Hi Aryhann,
I\'m not a coder but I\'ll try to answer your questions as best as I can.

ad1) Emitter resource is a sound that has a defined position in map (either a static mesh or coordinates), maximum volume and max/min range. This is specified in sound.xml within the map .zip archive.
The resource name of the sound and the file path, is specified in soundlib.xml.

We don\'t have emitter system for moving meshes like monsters and player chars yet.

ad2) No idea, never seen that before, don\'t know what\'s it for.

ad3) We have two layers of background stuff, music and ambience (noises). As for the two names, they might mean the same thing - music, or the \"Ambient music\" in fact means the ambience layer of sound. Depends where have you seen it and in what context.

ad4) Can\'t reproduce the problem. What renderer do you use?
Music/sound department

AryHann

  • Veteran
  • *
  • Posts: 1244
  • WonderWoman
    • View Profile
(No subject)
« Reply #2 on: March 06, 2005, 04:32:24 pm »
Hi!

Thanks for answering!

1) when you choose a \"mesh\", I guess it is necessary to specify the name of the object and not of the factory, or is it possible to associate a sound also to a factory?
In any case, I saw that it is something like _s_nameobj.
Is it correct? the _s_ just state that we are talking about sounds?

Have you ever got the crash I got? Because I haven\'t applied to anything that was movable. It was a thingmesh...

Maybe I have defined it wrong.

2) Well, somebody will know :-)

3) Uhm, so for example, for \"ambient\" you intend \"birds and wind\" in a landscape, while background is properly music, right?

4) what do you mean with renderer? ;-)

Ary
AryHann

http://www.reflex.lth.se/culture/annelov - Virtual Annelöv -
Engine Dep. - One of Talad's Angels - Aka ww & Ahrijani's Goddess

GeorgeD

  • Hydlaa Resident
  • *
  • Posts: 93
    • View Profile
(No subject)
« Reply #3 on: March 06, 2005, 05:52:53 pm »
1) You have to use the mesh name from the world file. Let\'s say you want to assign sound to a tree, so you\'ll look it up in the map world file (terrible task, that\'s why we use coords in most cases). Let\'s say the meshobj name is \"_t_ctwr0022\". So instead of coordinates you have to put this line in sound.xml: MESH=\"_t_ctwr0022\"

As for the crash, no, my client hasn\'t crashed because of sound for a long time. Make sure you have all the parameters set correctly, including the file alias, that the path in soundlib links to an existing file and the alias is identical to the one in sound.xml.

2) Hopefully  :P

3) Right.

4) Sound renderer. PS has three options. Software sound, Direct Sound 3D and OpenAL. You can set it up in pssetup.exe
Software sound is recommended because all we do is meant to work with softsound in the first place.

EDIT: Just went down to dungeon and found out that assigning sounds to meshes doesn\'t work anymore. The 4 torches down there are silent. Gotta fix the sound.xml and use coordinates instead. *grumbles*
« Last Edit: March 06, 2005, 06:10:30 pm by GeorgeD »
Music/sound department

AryHann

  • Veteran
  • *
  • Posts: 1244
  • WonderWoman
    • View Profile
(No subject)
« Reply #4 on: March 07, 2005, 10:25:05 am »
Hi!!

First of all, I have other questions.

A)Where is defined the rain and thunder sounds in Crystal Blue? I cannot find it in the soundlib.xml (while instead, for the CVS version, probably MB, it was there).

B) If I have an emitter for a sound, that is in the category \"ambience\" ? I mean, when I regulate the \"volume\" in the options, the emitter volume will be considered under background, ambience or something else?

C) when sound.msg.info is \"called\"? Since the sound is a temporary one (at least, I guess so, since it is zzz.wav) I don\'t understand which is the \"action\" connected to it.

D) Is it possible to associate an emitter sound to an item?
Going back to the other questions, instead:

1) I ll try to make some test. You assign a sound to a single instance of a tree, or to the whole \"class\" of the same kind of trees?
Argh, I read the EDIT now -> no more meshes, but just coordinates, then?

I ll try to create another emitter and see if it crashes, again...

Jumping 2 and 3, we go to 4) my personal pssetup doesn\'t work properly.

4)System.PlugIns.iSoundRender = crystalspace.sound.render.software
I haven\'t investigate what happens with OpenAL.


More, I think I have a little bug ? When I change the options and take away the background music, the background music disappear properly. then, if I try to put it back, the volume is so low that it is hardly possible to ear the music again?!

Something really strange happened: I have substitute the click buttons from the CVS with some I have, and if before I was listen to some sort of sound when I was clicking the toolbar, now it is completely silent and I don\'t get any error over the fact that the sounds are missing.
Some idea?

Ary
« Last Edit: March 07, 2005, 06:03:21 pm by AryHann »
AryHann

http://www.reflex.lth.se/culture/annelov - Virtual Annelöv -
Engine Dep. - One of Talad's Angels - Aka ww & Ahrijani's Goddess

GeorgeD

  • Hydlaa Resident
  • *
  • Posts: 93
    • View Profile
(No subject)
« Reply #5 on: March 11, 2005, 06:43:46 pm »
A) It should work the same way as it did in MB, we just don\'t have weather changes in CB yet.

B) Map emitters are adjustable by the ambience slider, they are part of the \"ambient background\" sound.

C) That one is triggered on any system message in chat window, so we muted it.

D) No idea, didn\'t need to do this yet.

Quote

Something really strange happened: I have substitute the click buttons from the CVS with some I have, and if before I was listen to some sort of sound when I was clicking the toolbar, now it is completely silent and I don\'t get any error over the fact that the sounds are missing.
Some idea?


Sounds like you broke it, that\'s all I can think of after reading this  :D
Music/sound department