Package com.golden.gamedev.engine

Examples of com.golden.gamedev.engine.BaseAudioRenderer


                if(this.currentState == PlayerConstants.DirectionRight)
                {
                }

                game.bsMusic.stopAll();
                BaseAudioRenderer dummy;

                if (game.GetSoundState())
                {
                    try{
                        dummy = game.bsSound.getAudioRenderer(
View Full Code Here


                        Hero.setScore(Hero.getScore() + GameConstants.Perfect);

                        if(GameRef.GetSoundState())
                        {
                            try{
                                BaseAudioRenderer dummy = GameRef.bsSound.getAudioRenderer(
                                    GameRef.bsSound.play(SoundStrings.AllBlocksCorrect, BaseAudio.SINGLE));

                                /** @TODO: Linux problem */
                                //Wait for sound to play
                                //while (dummy.getStatus() != BaseAudioRenderer.END_OF_SOUND){ /* Empty */ }
View Full Code Here

            if (s2 instanceof Player)
            {
                try
                {
                    int slot;
                    BaseAudioRenderer test = null;
                    if(GameRef.GetSoundState())
                    {
                        slot = GameRef.bsSound.play(SoundStrings.DoorExit, BaseAudio.SINGLE);
                        test = GameRef.bsSound.getAudioRenderer(slot);
View Full Code Here

 
  /**
   * Testing the MP3 Player.
   */
  public static void main(String args[]) {
    BaseAudioRenderer mp3 = new JavaLayerMp3Renderer();
   
    String music1 = "file:///d:/golden t studios/trash/sound/MUSIC1.MP3";
    String music2 = "file:///d:/golden t studios/trash/sound/music2.mp3";
   
    if (args != null) {
      if (args.length >= 1) {
        music1 = music2 = args[0];
      }
      if (args.length >= 2) {
        music1 = args[1];
      }
    }
   
    // test first song
    try {
      mp3.play(new URL(music1));
    }
    catch (Exception e) {
      e.printStackTrace();
    }
   
    // hear some music
    int update = 0;
    while (mp3.getStatus() == BaseAudioRenderer.PLAYING) {
      try {
        Thread.sleep(1000);
      }
      catch (InterruptedException e) {
      }
     
      System.out.println(update++);
     
      if (update > 4) {
        mp3.stop();
      }
    }
   
    // first song stopped
    System.out.println("end-song");
   
    // test second song
    try {
      mp3.play(new URL(music2));
    }
    catch (Exception e) {
      e.printStackTrace();
    }
   
    // wait until complete
    while (mp3.getStatus() == BaseAudioRenderer.PLAYING) {
      try {
        Thread.sleep(1000);
      }
      catch (InterruptedException e) {
      }
View Full Code Here

 
  /**
   * Testing the OGG Player.
   */
  public static void main(String args[]) {
    BaseAudioRenderer ogg = new JOrbisOggRenderer();
   
    String music1 = "file:///d:/golden t studios/trash/sound/MUSIC2.ogg";
   
    if (args != null) {
      if (args.length >= 1) {
        music1 = args[0];
      }
    }
   
    // test first song
    try {
      ogg.play(new URL(music1));
    }
    catch (Exception e) {
      e.printStackTrace();
    }
   
    // hear some music
    int update = 0;
    while (ogg.getStatus() == BaseAudioRenderer.PLAYING) {
      try {
        Thread.sleep(1000);
      }
      catch (InterruptedException e) {
      }
     
      System.out.println(update++);
     
      if (update > 6) {
        ogg.stop();
      }
    }
   
    // first song stopped
    System.out.println("end-song");
   
    // try {
    // ogg.play(new URL("file:///d:/golden t studios/trash/songtitle.ogg"));
    // } catch (Exception e) { e.printStackTrace(); }
   
    // play it again
    ogg.play();
   
    // wait until complete
    while (ogg.getStatus() == BaseAudioRenderer.PLAYING) {
      try {
        Thread.sleep(1000);
      }
      catch (InterruptedException e) {
      }
View Full Code Here

TOP

Related Classes of com.golden.gamedev.engine.BaseAudioRenderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.