Jump to content


Photo

Add sound file for warnings?


  • Please log in to reply
2 replies to this topic

#1 Thanøs

Thanøs

    Glass Joe

  • New Members
  • 2 posts

Posted 05 June 2014 - 04:35 PM

So I was looking to add a sound file for warnings. I googled a bit had little luck finding anything. There does not seem to be an option and theres no obvious place in the dbm folders to add a sound file so it appears in the list of sounds.

 

So how would I go about getting this done?

 

 

edit: Found info on SharedMedia but I am struggling to get this to work I have done the following:

 

Downloaded Sharedmedia and Libstub addons via Curse Client

 

Added a MyMedia folde rint he addons folder

 

Copied the libs folder from SharedMedia to the My Media folder

 

Created the following text files

## Interface: 40100
## Title: SharedMedia - MyMedia
## Notes: Inserts some media into LibSharedMedia's storage.
## Version: 3.0.4-179
## Author: Elkano
## OptionalDeps: LibStub, LibSharedMedia-3.0

#@no-lib-strip@
libs\LibStub\LibStub.lua
libs\CallbackHandler-1.0\CallbackHandler-1.0.lua
libs\LibSharedMedia-3.0\lib.xml
#@end-no-lib-strip@

MyMedia.lua

saved this as MyMedia.toc in the MyMedia folder as "All files"

 

As well as this text file

local LSM = LibStub("LibSharedMedia-3.0")

LSM:Register("sound",[[Interface\AddOns\MyMedia\sound\dodge.mp3]])

I also added a folder callefd sound tot he my Media folder and added the dodge.mp3 file to it

 

 

I feel I am close and assume I have screwed something up in the code above.


Edited by Thanøs, 05 June 2014 - 05:28 PM.


#2 MysticalOS

MysticalOS

    French Hacker

  • ♦ Administrators
  • 896 posts
  • LocationGeorgia

Posted 05 June 2014 - 08:18 PM

text file? you need a lua file, which is also defined in your mymedia.toc file, it needs to be a working addon. You also need to make sure toc has set optional dependency on libsharedmedia to ensure it loads first. There is no short way to explain all of it though.

#3 Thanøs

Thanøs

    Glass Joe

  • New Members
  • 2 posts

Posted 06 June 2014 - 01:39 PM

Yes of course forgot to type out that the second text file was saved as a lua file using the  "all files" setting as MyMeda.lua

 

I figured out my problem though it seems

 

this line:

LSM:Register("sound",[[Interface\AddOns\MyMedia\sound\dodge.mp3]])

should have been

LSM:Register("sound", "Name", [[Interface\AddOns\MyMedia\sound\dodge.mp3]])

I did not realize that "sound" was an identifier telling what the file is and the "name" part is the title of the file as it would appear in the drop down list in game. I named it "Dodge!" in my case.

 

 

Any chance you can add the ability for custom sound files into DBM so it is a bit easier to do? Granted at this point it is sort of easy for me to do, more sound files juat need to be dropped into the sound folder and a new LSM:Register line added to the lua file that points ot the sound. But I imagine some DBM users might not want to go through all this to get the desired effect.


Edited by Thanøs, 06 June 2014 - 01:48 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users