Control Volume

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Control Volume

Postby proy » Fri Jun 19, 2009 12:17 pm

hi,

I've spent the last couple of weeks going through the thoughtful tutorials provided by the members on this forum and I catually thought I was finally getting somewhere with AM. I was feeling preety confident when I ran into a snag. :oops:

My problem lies with the menu. I am trying to create a customised menu with an "Options" button like on those professional games. I think it'd be great to provide the player with a way to individually control the music and the environmental sound.

Now is there was way to do that in AM? Any help will be greatly appreciated. :D
proy
Junior Member
 
Posts: 15
Joined: Mon Jun 08, 2009 5:24 am

Postby mercedes » Fri Jun 19, 2009 12:47 pm

Hi there..Welcome to the forums!~..:D

That is a good question. You can try EZ-Talk it's a plug-in created by Shadow Hunter, and it has volume properties...

EZ-TALK

There may be other ways as well..this is just one option, and I'm not sure if its what you are looking for...:)
I'm sure there will be other options as well..Lyberodoggy or someone may know of another way..:)



Peace
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Mystery » Fri Jun 19, 2009 1:05 pm

What would you like to include in the options?

Music on/off
Environmental sounds on/off

Or more?
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby proy » Fri Jun 19, 2009 2:05 pm

Mercedes, thank you so much. :D I am really liking it here. I'am going to request Shadow to send me the key to Ez-Talk right away.

Mystery wrote:What would you like to include in the options?

Music on/off
Environmental sounds on/off

Or more?


I would like the player to have a little more control than just turning it on or off. What I would like is to have horizontal sliders to increase/decrease volume from 0 to 100 so that the player could decide for himself/herself how high or low he/she wants the sound to be.
proy
Junior Member
 
Posts: 15
Joined: Mon Jun 08, 2009 5:24 am

Postby Mystery » Fri Jun 19, 2009 2:12 pm

From other threads you can see that EZTalk provides volume control:
http://www.adventuremaker.com/phpBB2/vi ... php?t=4702
http://www.adventuremaker.com/phpBB2/vi ... php?t=2972

But I don't think that it works as slider control.

Maybe somebody has a good idea for your question.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Lyberodoggy » Fri Jun 19, 2009 2:14 pm

To do so (and actually have slidebars), you are gonna need a lot of coding (drag n drop hotspot, divide the part of the bar that is selected by the whole bar size in pixels, convert to an integer ranging inside the volume control range and then set the value). If you decide to do so, I 'd love to help
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Lyberodoggy » Fri Jun 19, 2009 2:55 pm

Lyberodoggy wrote:To do so (and actually have slidebars), you are gonna need a lot of coding (drag n drop hotspot, divide the part of the bar that is selected by the whole bar size in pixels, convert to an integer ranging inside the volume control range and then set the value). If you decide to do so, I 'd love to help



Made a sample project for you (no graphics, just a blank frame and a key for the slider)
You will need shadowhunter's keyguard plugin
Attachments
slidebar selector.zip
(105.9 KiB) Downloaded 360 times
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby proy » Fri Jun 19, 2009 3:37 pm

Lyberodoggy, it is inredibly kind of you to come to my aid.

I'm getting now that it is going to be very difficult to do what i'd like to do. Thanks so much for the file.

Now, I had a wild idea to use flash to make the slider control and i was also able to do it using flash cs4. But i am stuck at how to associate the flash control with the volume of the .ogg files that will be there. Is there any way to do that?

Anways, i really wanted to thank all of you for your help. it's one of the thinks i love about this forum - how the advanced users readily help novices like me. :D
proy
Junior Member
 
Posts: 15
Joined: Mon Jun 08, 2009 5:24 am

Postby Lyberodoggy » Fri Jun 19, 2009 4:09 pm

Yeah, that's mainly what we do around here (and makes us feel like "advanced users" :lol: )

I really like coding and helping by the way
Well, I recall a topic about passing vars through a flash object. I wouldn't recommend that though.

If we modify the sample I made just a little bit, we can set the volume property of EZTalk or even the volume of a MediaPlayerObject instead of projecting the value in the text.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Fri Jun 19, 2009 6:46 pm

Or u can use buttons--Up and down buttons..
But it won't be like the hidden object games..that I've seen with the same controls..you speak of ..I'm assuming u too got the idea from them..? :D
This is an excellent feature Doggie..I hope it comes together..:D:D
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby proy » Sat Jun 20, 2009 2:51 am

Lyberodoggy wrote:Yeah, that's mainly what we do around here (and makes us feel like "advanced users" :lol: )

I really like coding and helping by the way
Well, I recall a topic about passing vars through a flash object. I wouldn't recommend that though.

If we modify the sample I made just a little bit, we can set the volume property of EZTalk or even the volume of a MediaPlayerObject instead of projecting the value in the text.


This is a great idea. I've asked Shadowhunter for a key and when he gets back to me, I'll try to figure out how EZ-Talk works. I look forward to asking for your help on this project soon. :)

mercedes wrote:Or u can use buttons--Up and down buttons..
But it won't be like the hidden object games..that I've seen with the same controls..you speak of ..I'm assuming u too got the idea from them..? :D
This is an excellent feature Doggie..I hope it comes together..:D:D


You caught me. :D I love the hidden object games. Some of them are really entertaining. I hope this feature comes together too. (fingers crossed.)
proy
Junior Member
 
Posts: 15
Joined: Mon Jun 08, 2009 5:24 am

Postby Mystery » Sat Jun 20, 2009 5:28 pm

If you contact ShadowHunter, make sure that you rather send him a PM on the forums and not an email :)
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby proy » Sun Jun 21, 2009 6:35 pm

Thanks Mystery, for your advice.
I have already contacted ShadowHunter. I'm sure he'll reply soon. :D
proy
Junior Member
 
Posts: 15
Joined: Mon Jun 08, 2009 5:24 am

Postby proy » Tue Jun 23, 2009 10:53 am

Thanks to ShadowHunter, I, now have a copy of EZTalk and have gotten...nowhere. :oops:
Utilising the demo, I can control the volume of a .wav file in the External folder of the project. But that, unfortunately does not solve my particular problem.

I still have no way to give the player a way to control the volume of the music and background sound(in .ogg format).

So, I am again asking for help. I would really appreciate it. :D
proy
Junior Member
 
Posts: 15
Joined: Mon Jun 08, 2009 5:24 am

Postby Lyberodoggy » Tue Jun 23, 2009 1:04 pm

Code: Select all
Sub PlaySound(FileName, Repeat)
  Action.LoadControl MediaPlayerObject(2)
  MediaPlayerObject(2).FileName = FileName
  If Repeat = True Then
    MediaPlayerObject(2).PlayCount = 0
  Else
    MediaPlayerObject(2).PlayCount = 1
  End If
  MediaPlayerObject(2).Volume=-600
  MediaPlayerObject(2).Play
End Sub



Use this code, then play with the MediaPlayerObject(2).Volume property
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby proy » Wed Jun 24, 2009 5:44 am

Lyberodoggy wrote:
Code: Select all
Sub PlaySound(FileName, Repeat)
  Action.LoadControl MediaPlayerObject(2)
  MediaPlayerObject(2).FileName = FileName
  If Repeat = True Then
    MediaPlayerObject(2).PlayCount = 0
  Else
    MediaPlayerObject(2).PlayCount = 1
  End If
  MediaPlayerObject(2).Volume=-600
  MediaPlayerObject(2).Play
End Sub



Use this code, then play with the MediaPlayerObject(2).Volume property


Please correct me, if I'm wrong. But this code is to play a sound, isn't it?

My problem is to find a way for a player to be able to control the volume of the music and atmospheric sounds(a no. if files in .ogg format) with two different sliders. This is the sort of controls found it most 2d and 3d games. As you have already provided me with a code to make a horizontal slider, my problem is to control the sound, the solution to which still eludes me.
proy
Junior Member
 
Posts: 15
Joined: Mon Jun 08, 2009 5:24 am

Postby mercedes » Wed Jun 24, 2009 6:01 am

The code does have volume property...; :)

Code: Select all
MediaPlayerObject(2).Volume=-600


You would play with that.. -200 ect..

The slider you would have to make yourself..and use it with a .move code..or Keyguard[different plugin]--I think Keygaurd would work best...I think..? Lyberodoggy might have something different in mind as well..~:)

With each movement.. Keygaurd using MOUSE UP and MOUSE DOWN event...
You would call for all routines to move the slider..
Sound -Mouse up - Mouse down.
Mouse down--the volume goes up or down.. -200 -100 ect..
Mouse up----the volume stays put..where it's left off..?


That's how I can see it being done as well....Perhaps Lyberodoggy has a different way in mind though...~
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Wed Jun 24, 2009 12:33 pm

I 'm uploading a newer version of the sample project. It has one sound file and you can change its volume by dragging the hotspot. Try it :)


EDIT: cannot upload quite yet...


DOUBLE EDIT: here it is http://files.filefront.com/slidebar+selectorzip/;13926076;/fileinfo.html
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Wed Jun 24, 2009 1:16 pm

Oh I missed your post entirely where u uploaded a sample..i was wondering when u said ''newer version''...Had to look back in the thread..:lol:

That's so cool...gonna have to look at that ..:D
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby proy » Thu Jun 25, 2009 9:08 am

Lyberodoggy and Mercedes, thank you so much for helping me out. :D

if my project works, i'll post it here.
proy
Junior Member
 
Posts: 15
Joined: Mon Jun 08, 2009 5:24 am

Postby proy » Fri Jun 26, 2009 3:09 pm

Hi Guys,

As promised i've uploaded my project here. It still has lots of kinks but i'll be very happy, if it is of some use to somebody. :)
My heatfelt thanks to Lyberodoggy and mercedes for helping me get here. :D

anyways, i've come to a new problem. :(
i've made my slidebar(tweaked Lyberodoggy's code to match my specifications) and can also control the volume of music on other frames with the slidebar.
but my problem is that when i add another layer of sound(for eg. if a hotspot is clicked and a sound is emitted), then the background sound stops.
Is there anyway to have both the sounds at the same time?
As always, any and all help will be greatly appreciated.
Attachments
Volume_Control.rar
(392.74 KiB) Downloaded 366 times
proy
Junior Member
 
Posts: 15
Joined: Mon Jun 08, 2009 5:24 am

Postby reneuend » Fri Jun 26, 2009 3:33 pm

Yes. You need to play them on a different channel. :)
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Fri Jun 26, 2009 7:17 pm

Hi there...:D

If you always want noise in the background--to stay playing--when they enter a frame..
Use the Frames' properties Audio Channel--First one..
Then in a hotspot..use the second one down..
This way the background noise doesn't get interrupted..when they click a hotspot..:)
Same goes if the background noise starts with a hotspot--use first channel..second for the other hotspots..and so on..depending on how many noises u want and how many you want to stay playing..~


Peace
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby juhuwoorps » Fri Jun 26, 2009 7:57 pm

if i use scripting to play sounds, how do i change the channel?
juhuwoorps
Code Master
 
Posts: 622
Joined: Tue Jul 08, 2008 3:13 pm

Postby reneuend » Fri Jun 26, 2009 8:27 pm

I had this article in the Bite By Byte magazine.
Attachments
Multiple sounds with PlaySound subroutine.doc
(23 KiB) Downloaded 225 times
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby juhuwoorps » Fri Jun 26, 2009 9:33 pm

thank you. i forgot about it! Sometimes we should remember our magazin with a lot of helpfull things!
juhuwoorps
Code Master
 
Posts: 622
Joined: Tue Jul 08, 2008 3:13 pm

Postby Lyberodoggy » Fri Jun 26, 2009 10:58 pm

Just make sure to set the volume level in all used channels

Code: Select all
For each mpo in mediaplayerobject
mpo.volume=thevariablethatstoresthevalue
next
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby proy » Sat Jun 27, 2009 7:50 am

thanks guys for your help. due to that, I think now the volume_control work the way i wanted it to.
But I have one question before I'm done. What are the values of maximum and minimum values of volume in a MediaPlayerObject.
Anways, you guys have been great the way you've helped me. I really appreciate it. :D
proy
Junior Member
 
Posts: 15
Joined: Mon Jun 08, 2009 5:24 am

Postby Lyberodoggy » Sat Jun 27, 2009 10:08 am

I don't really know about the min-max. I hardcoded -4500 as the min and 0 as the max, but I found those values experimenting with them, so I don't know if they are the real min max. Actually. -200 sounds pretty much the same as 0. -4500 is where the sound stopped sounding.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby proy » Sat Jun 27, 2009 2:24 pm

sound stopped sounding
:lol:

in my case, i could still hear the music when it was -6750. Well, i suppose i have to add a mute button. :D
proy
Junior Member
 
Posts: 15
Joined: Mon Jun 08, 2009 5:24 am

Next

Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron