Article View: borland.public.jbuilder.java.language
Article #7918Re: using .wav files
From: paul nichols
Date: Tue, 01 May 2001 20:39
Date: Tue, 01 May 2001 20:39
52 lines
2356 bytes
2356 bytes
Can't be Dave, because you have no way of knowing what OS that the Java app
will be running on. However, you could make a native call using JNI, if you
know the system you are communicating with (ie Windows, Linux).
Example:
public void runPlaySound() {
try {
Runtime rt=Runtime.getRunTime();
rt.exec("SomeWavFile.exe");
}
catch (Exception rtex) {
rtex.printStackTrace();
}
}
"Dave Cullen" <no_spam@mail.com> wrote in message news:3aeece3b_1@dnews...
> Looked at that... far more complicated than I expected. I just wanna play
a
> .wav, not become an expert in digital sampling
>
> In VC++ I'd just #include <mmsystem.h> and use one line:
> PlaySound("UPDATE.WAV",NULL,SND_FILENAME | SND_SYNC);
>
> I was hoping Java would be as simple. Guess not.
>
> drc
>
> "paul nichols" <paul@computer-logic.net> wrote in message
> news:3aee585d$1_2@dnews...
> > try downloading the Java Media Framework
(http://java.sun.com/products/).
> >
> >
> > "Dave Cullen" <no_spam@mail.com> wrote in message
news:3aed5f8e_1@dnews...
> > > What's the most direct way to load and play a .wav file in a Java
> > > appliction? I found some multimedia classes in the docs, but they all
> seem
> > > to inherit from applet.
> > >
> > > tnx.
> > >
> > > drc
> > >
> > >
> > >
> >
> >
>
>
Technical Details
Message-ID:
<3aef1f21$1_1@dnews>Path:
arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3aed5f8e_1@dnews> <3aee585d$1_2@dnews> <3aeece3b_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,d893aad0b59add1b X-Google-Attributes: gidf74b3,public X-Google-Thread: f7754,d893aad0b59add1b X-Google-Attributes: gidf7754,public X-Google-ArrivalTime: 2001-05-01 13:44:03 PST From: "paul nichols" <paul@computer-logic.net> Newsgroups: borland.public.jbuilder.java.language,borland.public.jbuilder.students References: <3aed5f8e_1@dnews> <3aee585d$1_2@dnews> <3aeece3b_1@dnews> Subject: Re: using .wav files Date: Tue, 1 May 2001 16:39:37 -0400 Lines: 54 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 24.159.98.249 Message-ID: <3aef1f21$1_1@dnews> X-Trace: dnews 988749601 24.159.98.249 (1 May 2001 13:40:01 -0700) Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews