Go Back   The macosxhints Forums > Working with OS X > OS X Developer



Reply
 
Thread Tools Rate Thread Display Modes
Old 04-01-2002, 07:11 PM   #1
Bishop
Prospect
 
Join Date: Mar 2002
Posts: 16
Java with sound

This code ...

protected Mixer theMixer;
protected AudioFormat audioFormat = new AudioFormat(44100.0F, 16, 1, false, true);
protected TargetDataLine recorder;

public AudioLayer()
{
Mixer.Info mixerInfo;
Object tmp = null;
DataLine.Info dLine = new DataLine.Info(TargetDataLine.class, audioFormat);

ListMixers();
mixerInfo = GetMixerInfo("Mac OS X,CoreAudio,Audio hardware");
System.out.println("Useing mixer: " + mixerInfo.getName());
theMixer = AudioSystem.getMixer(mixerInfo);
try {
tmp = theMixer.getLine(dLine);
} catch(Exception e) { System.err.println("\nException: " + e); System.exit(73); };


... produce this result


Available Mixers:
Java Sound Audio Engine
Mac OS X,CoreAudio,Audio hardware
Mac OS X,CoreAudio,Audio hardware
Useing mixer: Mac OS X,CoreAudio,Audio hardware

Exception: java.lang.IllegalArgumentException: Line unsupported: interface TargetDataLine supporting format PCM_UNSIGNED, 44100.0 Hz, 16 bit, mono, big-endian, audio data

talk2U.app has exited with status 73.

Anyone know why? This is my first experince useing sound in java so it might be something obvious. Sorry for the large amount of code included but I could not think of a better way to explain this problem.

/Bishop

Last edited by Bishop; 04-01-2002 at 07:14 PM.
Bishop is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 05:42 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.