Article View: borland.public.jbuilder.java.language
Article #7929Re: using .wav files
From: paul nichols
Date: Wed, 02 May 2001 10:33
Date: Wed, 02 May 2001 10:33
36 lines
2102 bytes
2102 bytes
"John McGrath [TeamB]" <ng-b@JPMcGrath.net> wrote in message
news:MPG.155962e4c41d0d8f98a176@forums.borland.com...
> On Tue, 1 May 2001 21:38:41 -0400, paul nichols wrote:
>
> > It does add overhead, but I found the libs actually easy to
> > work with. Some real power features in JMF as well.
>
> Can you point me to the play(URL) method or its equivalent?
>
Here is a code snippet that will make it work
package <somepackagename>
import javax.media.bean.playerbean.MediaPlayer;
import javax.media.*;
import javax.swing.JOptionPane;
import java.net.URL;
public class MyMediaPlayer() {
startThePlayer() {
MediaPlayer player=new MediaPlayer();
try {
MediaLocator ml=new MediaLocator(new
URL("file://windows\media\tada.wav"));
player.setMediaLocator(ml);
player.setPlaybackLoop(false);
player.start();
}
catch(Exception ex) {
JOptionPane.showMessageDialog(null,"Error !! "+ex.getMessage());
}
}
}
Hope this helps!!
Technical Details
Message-ID:
<3aefe295$1_2@dnews>Path:
arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp1.njy.teleglobe.net!teleglobe.net!hub.org!hub.org!PeerFeed.KWeb.on.ca!dnewsReferences:
<3aed5f8e_1@dnews> <3aee585d$1_2@dnews> <3aeece3b_1@dnews> <3aef3d4b_1@dnews> <3aef6539$1_2@dnews> <MPG.155962e4c41d0d8f98a176@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7754,d893aad0b59add1b X-Google-Attributes: gidf7754,public X-Google-Thread: f74b3,d893aad0b59add1b X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-05-02 03:38:02 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> <3aef3d4b_1@dnews> <3aef6539$1_2@dnews> <MPG.155962e4c41d0d8f98a176@forums.borland.com> Subject: Re: using .wav files Date: Wed, 2 May 2001 06:33:32 -0400 Lines: 39 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: <3aefe295$1_2@dnews> X-Trace: dnews 988799637 24.159.98.249 (2 May 2001 03:33:57 -0700) Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp1.njy.teleglobe.net!teleglobe.net!hub.org!hub.org!PeerFeed.KWeb.on.ca!dnews