Playing sounds in sketchup
-
Hi all!
Do you guys know a way of playing sounds in sketchup!
Is there a script that could do that, triggered by clicking on a scene or something like that.Thank you!!
-
Many years ago TBD made one called suave.rb.
-
As well as TBD's
suave.rb
there are the simple API methods
UI.beep
for a simple system-beep
UI.sound(path_to_sound_file)
for a .wav file osa...
To attach it to an object requires more code...
Didier Bur's script to useUI.openURL(url)
when you click an object [can't recall its name off-hand] could be easily modified to play a sound with the code above... -
Wax has been experimenting using midi events triggered by relight in Thea render. He is doing some really fun stuff, that may be of interest. http://www.thearender.com/forum/viewtopic.php?p=35463#p35463
-
Thanks for response!
the suave might be perfect!the ui stuff sounds good aswell..
thank you!
-
And there is the ever popular Homer Button:
http://forums.sketchucation.com/viewtopic.php?p=6879#p6879 -
Thank you guys!
I'm having trouble to get the SUAVE to work..
is there anyone that have got it working? apparently the demo is playing m03 files? never heard of them!I'm using su 8!
-
@tig said:
As well as TBD's
suave.rb
there are the simple API methods
UI.beep
for a simple system-beep
UI.sound(path_to_sound_file)
for a .wav file osa...
To attach it to an object requires more code...
Didier Bur's script to useUI.openURL(url)
when you click an object [can't recall its name off-hand] could be easily modified to play a sound with the code above...As I cant get the suawe to work I'm trying the above method, but I cant find that peice of code from Didier Bur to attach it to an object.
cheers! -
Try this http://rhin.crai.archi.fr/rld/plugin_details.php?id=799
It's for URLs BUT could be adapted to play sounds... -
Thank you TIG!
i installed it but it doesnt work for some reason, wont launch the html interface.
How could i modify it to play audio files instead? -
@mr tee said:
Thank you TIG!
i installed it but it doesnt work for some reason, wont launch the html interface.
How could i modify it to play audio files instead?Sorry! I mis-linked http://rhin.crai.archi.fr/rld/plugin_details.php?id=229 is
links.rb
what you want the other is a links manager and is encrypted too!
Download and read the file in Notepad...
You will see that it links files/urls to objects - you need to link sound files to objects...
It also usesUI.openURL(filepath)
you'd substitute that withUI.play_sound(soundpath)
... -
@unknownuser said:
And there is the ever popular Homer Button:
http://forums.sketchucation.com/viewtopic.php?p=6879#p6879Thanks BooFredlay!
This would also work actually. but myexperience in Ruby isnt that good.
I've managed to make custom button image and custom sound, but i wonder how to ad more buttons in that tool bar?(see code below)
Is there a way to make the buttons longer?plugins = Sketchup.find_support_file("Plugins")
sfile = File.join(plugins, "ljudstudie", "r1.wav")
icon = File.join(plugins, "ljudstudie", "r1.png")
tb = UI::Toolbar.new("Ljudstudie")
cmd = UI::Command.new("Doh") { UI.play_sound(sfile) }
cmd.small_icon = icon
cmd.large_icon = icon
cmd.tooltip = cmd.status_bar_text = "R1"
tb.add_item(cmd)
tb.show -
@tig said:
@mr tee said:
Thank you TIG!
i installed it but it doesnt work for some reason, wont launch the html interface.
How could i modify it to play audio files instead?Sorry! I mis-linked http://rhin.crai.archi.fr/rld/plugin_details.php?id=229 is
links.rb
what you want the other is a links manager and is encrypted too!
Download and read the file in Notepad...
You will see that it links files/urls to objects - you need to link sound files to objects...
It also usesUI.openURL(filepath)
you'd substitute that withUI.play_sound(soundpath)
...Thanks!
I had a look at the code, did u mean copy bits of the code.
is that possible to make an object act as a button which trigger a sound stored on the harddrive somewhere? -
The original code makes objects open 'attached' URLs.
If you substitute a 'sound-file-path' for the url/file-path and adjust other commands it should play the sound...
Obviously it's somewhat more complex than that, BUT you could copy the links.rb and rename it and its def methods, substituting suitable stuff for sound file [.wav] in place of url/file-path and UI.play_sound() in place of UI.openURL().........
You can't make a button - the url-link works off the context-menu BUT perhaps DCs have something ??? -
ok!
DC's? -
-
Just curious, anyone had suawe working?
I managed to get the script installed and the demoscene loads fine, but I cant hear any sound!I'm running SU 8!
Advertisement