Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help verifying bug in javax.sound.sampled playback on 10.5.1 with java 1.5.0_13-119



Would someone kindly try reproducing an audio problem I'm hearing on 10.5.1 with java 1.5.0_13-119? Basically when playing back an 8kHz 16- bit PCM audio I hear a weird "robotic" effect overlaid on the audio. This only happens when run under the 1.5 JVM not the 1.4 JVM.

Step:

1) Create the source file $TEST/c/v/TestAudio.java whose contents are attached below.
(where $TEST is some directory of your choice).


2) cd $TEST

3) compile the code:
/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Commands/ javac -source 1.4 c/v/TestAudio.java


4) try running under the 1.5 JVM:
/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Commands/ java c.v.TestAudio http://www.nch.com.au/acm/8k16bitpcm.wav



Do you hear weird "robotic" static over the top of the audio clip?


5) Note if you run under the 1.4 JVM and it sounds fine:
/System/Library/Frameworks/JavaVM.framework/Versions/1.4/Commands/ java c.v.TestAudio http://www.nch.com.au/acm/8k16bitpcm.wav


If its not specific to my system I'll report it to Apple

Thanks,

Eric


------------------------------------ TestAudio.java ------------------------------------ package c.v;

import java.io.IOException;
import java.net.URL;

import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.DataLine;

public class TestAudio {

  public static void main(String[] args) throws IOException {
    TestAudio.example(new URL(args[0]));
    System.exit(0);
  }

static public void example(URL url) throws IOException {
Clip clip = null;
AudioInputStream ais = null;
try {
ais = AudioSystem.getAudioInputStream(url);
DataLine.Info info = new DataLine.Info(Clip.class, ais.getFormat(),((int) ais.getFrameLength() * ais.getFormat().getFrameSize()));
clip = (Clip) AudioSystem.getLine(info);
clip.open(ais);
clip.start();
clip.drain(); // blocks until played


    } catch (Throwable e) {
      e.printStackTrace();
    } finally {
      if (clip != null)
        clip.close();
      if (ais != null)
        ais.close();
    }
  }

}

------------------------------

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.