[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 531
  • Last Modified:

Using the MASTER_GAIN method to change volume

Currently I have an applet which will play a short sound file.

Is it possible to add the MasterGain method of increasing dB to this??

This is how i'm playing the sound:-


 // Component initialization
     private void jbInit() throws Exception {
          try {
               clip = java.applet.Applet.newAudioClip(new java.net.URL(getCodeBase(),"1000Hz.au"));
               bnStart = new Button("Start");          
               bnStart.addActionListener(this);
               add(bnStart);
             
          } catch (Exception e) {
               e.printStackTrace();
          }
     }
     public void actionPerformed(ActionEvent e) {
          if (e.getSource() == bnStart) {
               clip.play();
          }
          else {
               clip.stop();
          }
     }
0
pigmentarts
Asked:
pigmentarts
  • 5
  • 5
2 Solutions
 
pigmentartsAuthor Commented:
thx interactive, i have to go now, but will get back to you about it soon
0
 
InteractiveMindCommented:
Sure.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
pigmentartsAuthor Commented:
Hmmm ok, I need some guidance here.

I don't think i need a mixer, and i'm a bit confused about what is meant by mixer

I don't need to present an interface which allows a user to change a  Clip being played.
Instead I want to add volume gain to a clip and play it back to the user. In the end playing the same clip at 5 different volume levels, say 10dB each time.

This is what i'm trying to understand now, am i on the right lines?

FloatControl FloatControl.Type

MASTER_GAIN  -  to increase the volume by 10dB?

SAMPLE_RATE - plays back the changed clip?


AUX_RETURN   -  to take the clip currently played

AUX_SEND - to play store the changed clip




0
 
pigmentartsAuthor Commented:
I shall continue reading from chapter one of http://java.sun.com/j2se/1.4.2/docs/guide/sound/programmer_guide
But i think i'm getting confused with functions I don't need.
0
 
pigmentartsAuthor Commented:
Could I have a bit more help on whereclasses like FloatControl should be placed, and how a particular method from it should be called.
0
 
InteractiveMindCommented:
Sorry, pigmentarts, I really don't know.
Keep reading that tutorial, I'm sure it will cover what you need, eventually ;)

Hopefully, Objects, will simplify things a bit for you, because I really have no idea. lol. Sorry.
0
 
pigmentartsAuthor Commented:
no problems matey. I'm a bit clearer on the how the sound API works.

The place where i'm falling down is on the basics of using classes and inheritence. I have done it before, but not in applets.
0
 
InteractiveMindCommented:
Well, it's the same for applets.. I'm guessing that you're having some problems when it comes to extending both the Applet, and some other required class? If so, let me know, and I'll give you a few ideas on how to get round this. :-)

Regards;
0
 
InteractiveMindCommented:
Thank you  :-)

As I've said, sorry that I couldn't help more.. it's just that changing the volume isn't an easy job, and not very well documented (from what I can see).

Good luck with the project!
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now