Author Topic: Music volume changable via scripting?  (Read 515 times)

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Music volume changable via scripting?
« on: March 17, 2015, 07:19:48 pm »


               

Like the topic says, is there a way to change the music volume via scripting?  To be clear, I mean the music tracks, not the ambient sounds.



               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Music volume changable via scripting?
« Reply #1 on: March 17, 2015, 07:32:29 pm »


               

I don't think it's feasible with vanilla libraries, although near every other sound function is there(changing/starting/stopping tracks, ambient volume day/night etc). Maybe with nwnx2...


 


 


Kato 



               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Music volume changable via scripting?
« Reply #2 on: March 17, 2015, 07:32:53 pm »


               

this would be huge!



               
               

               
            

Legacy_CaveGnome

  • Sr. Member
  • ****
  • Posts: 432
  • Karma: +0/-0
Music volume changable via scripting?
« Reply #3 on: March 17, 2015, 10:05:44 pm »


               if you dont need too numerous sound volume levels, there is a workaround. use a sound editor, load your music and reduce or increase the global output level, now save as many soundtracks as you need sound levels. in game just playing one file or another you are now able to change volume. a good sound editor that can do the trick: Audacity.
               
               

               
            

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Music volume changable via scripting?
« Reply #4 on: March 17, 2015, 11:55:16 pm »


               

Audacity is a must have editor, but I was looking for someway to do it in game. 



               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Music volume changable via scripting?
« Reply #5 on: March 18, 2015, 12:52:45 am »


               

The only way for music, is to rip them to .wav format, and include them as ambient sounds placed in the area. Then, use SoundObjectSetVolume to define its level of volume.


 


// Set the volume of oSound.

// - oSound

// - nVolume: 0-127

void SoundObjectSetVolume(object oSound, int nVolume)


This way will require a .hak download or an ambient download to dump to /ambient.


Either way, it's a download. There are no in-game script commands to adjust music level.


 


FP!



               
               

               
            

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Music volume changable via scripting?
« Reply #6 on: March 18, 2015, 02:52:01 am »


               

Oy, I can't believe I didn't think of that.


 


Thanks FP.