Audio player with some extra's - can't get player realized

I try to build an audio player with some extra's like looping between 2 time marks.
Till now i have an interface that can play back audio files but after that the problems start.
There is no way i can add functions without creating a {color:#ff0000}NotRealizedError{color}.
According to the documentation the start() method should realize (etc) the player, but it doesn't in my program and neighter does the method player.realize();.
Can someone give me a hint to get me on the road again.
Thanks in advance.
Here is the complete code which generates the NotRealizedError on the dp.setRate(); method:
(most of it is older source from a basic player on the internet).
package dictaplayer;
import java.awt.*;*
*import java.awt.event.*;
import java.io.*;*
*import java.net.MalformedURLException;*
*import java.net.URI;*
*import java.net.URL;*
*import javax.swing.*;
import javax.media.*;
public class DictaPlayer extends JFrame {
private Player dp;
private URI uri;
private URL url;
private boolean realized = false;
public DictaPlayer()
super( "Testing DictaPlayer" );
JButton openFile = new JButton( "Open file to play" );
openFile.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent e ) {
openFile();
createPlayer();
getContentPane().add( openFile, BorderLayout.NORTH );
setSize( 300, 300 );
setVisible(true);
private void openFile()
File file = null;
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(
JFileChooser.FILES_ONLY );
int result = fileChooser.showOpenDialog( this );
// user clicked Cancel button on dialog
if ( result != JFileChooser.CANCEL_OPTION )
file = fileChooser.getSelectedFile();
try {
uri = file.toURI();
} catch (SecurityException e) {
e.printStackTrace();
// Convert the absolute URI to a URL object
try {
url = uri.toURL();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
private void createPlayer()
if ( url == null )
return;
removePreviousPlayer();
try {
// create a new player and add listener
dp = Manager.createPlayer( url );
// blockingRealize();
dp.addControllerListener( new EventHandler() );
dp.start(); // start player
dp.setRate(2);
catch ( Exception e ){
JOptionPane.showMessageDialog( this,
"Invalid file or location", "Error loading file",
JOptionPane.ERROR_MESSAGE );
private void removePreviousPlayer()
if ( dp == null )
return;
dp.close();
Component visual = dp.getVisualComponent();
Component control = dp.getControlPanelComponent();
Container c = getContentPane();
if ( visual != null )
c.remove( visual );
if ( control != null )
c.remove( control );
private synchronized void blockingRealize() {
int teller = 1;
dp.realize();
while (!realized && teller <= 20) {
try {
wait(1000);
System.out.println("not realized " +teller);+
+teller++;
} catch (java.lang.InterruptedException e) {
System.exit(1);
public static void main(String args[])
DictaPlayer app = new DictaPlayer();
app.addWindowListener(
new WindowAdapter() {
public void windowClosing( WindowEvent e )
System.exit(0);
// inner class to handler events from media player
private class EventHandler implements ControllerListener {
public void controllerUpdate( ControllerEvent e ) {
if ( e instanceof RealizeCompleteEvent ) {
Container c = getContentPane();
// load Visual and Control components if they exist
Component visualComponent =
dp.getVisualComponent();
if ( visualComponent != null )
c.add( visualComponent, BorderLayout.CENTER );
Component controlsComponent =
dp.getControlPanelComponent();
if (!realized) {
System.out.println("not realized.");
if ( controlsComponent != null )
c.add( controlsComponent, BorderLayout.SOUTH );
c.doLayout();
}

captfoss,
Thank you for your comment.
captfoss wrote:
Start does realize the player, automatically, before it starts it... if it isn't realizing then it also isn't starting.Right, I thought so, but my test was wrong. I now tested it with getState() and I can see it's going from unrealized to realized.
First off, you can only call setRate on a player that is realized but not started... further, any of the calls like configure, realize, start, stop, etc... are non-blocking calls...so you have to wait for them to finish before you go on to the next step.So you say that when the rate is changed (f.i. by a user in a gui) the program first has to bring player in non-started realized mode (stop + realize), call the setRate() and start the player again (on the exact position it was stopped)?
The easiest solution would be to use Manager.createRealizedPlayer rather than Manager.createPlayer...Didn't find out yet why, but when i change this (only this), there is no playing.
Also, ++teller++ is about the most-confused looking code I've ever seen...Just like all the asterisks, i now know that code changes when i toggle between the tabs (rich/plain/preview) in the message box.
Beyond that, your "blocking realize" function doesn't appear to do anything except suggest you have no business coding anything this advanced. Your boolean value "realize" isn't ever changed, so, I'm not entirely sure what the point of that function is other than to wait 10 seconds.I got this somewhere from the internet. Thought it could help me realize the player, but it didn't (obvious) so i commented it out.
Slowly I begin to understand the basics of JMF (at least i think so), but I also understand that there are other (Java) ways to build the application I need. Unfortunatly I have to little (hardly any) knowledge of all those (sound) API's (f.i. JLayer) to find my way through them and to decide which is the best for my use (user controled audio playback (at least WAV and MP3) with looping possiblities between 2 marked positions).
If someone could give me an advise which API (method or whatever you call it) is best to focus on I shurely would appriciate that.

Similar Messages

  • Help with some questions I can't get answered

    Can you give me the specs for P6 re. P7. Does it only go by hours rather than day?
    I can't get any answers. I have been on the phone for three day and emailing also and no one has helped me yet.

    Data is stored at the database level in hours. You can alter the client to display time units as days under Edit>User Preferences... however this simply converts the hours to the specified time unit.

  • How to make an Mp3 player, with some neat looks?

    Hey guys,
    I need to make an mp3 player, with some nice looks.
    Please help!

    maybe try this
    http://jplayer.org/

  • I need music player with auto puss it can stop the music between songs  ?

    I need music player with auto puss it can stop the music between songs  ?

    Serial Number
    http://support.apple.com/kb/HT4061
    Sign in to My Support Profile
    https://supportprofile.apple.com/

  • I am on vacation, downloaded audio book to my ipad , but want it on my iPod,  share itunes acct with my husband,  how can I get book  to download  from shared acct to my iPod

    I am on vacation, downloaded audiobook , to my ipad, but want it on my iPod.   Share itunes with husband . How can I get book from ipad to iPod?

    If your iPod has a separate icloud account no you can't unless you sign out and sign in with the id you share and download it and sing in again with your id

  • HT4623 Hello! So I have a iPod 5th generation, and I just had a recent update, it was for iOS 6.1.3, and now for some reason, I can't get the iOS 7 update. Could anyone help me?

    Hello! So I have a iPod 5th generation, and I just had a recent update, it was for iOS 6.1.3, and now for some reason, I can't get the iOS 7 update. Could anyone help me?

    Apple's servers are slammed right now with iOS 7 downloads AND activation requests.
    Be patient and try again later.

  • Is there a fix for the WIFI problem with Lion? How can I get Lion off of my Mac?

    Is there a fix for the WIFI problem with Lion? How can I get Lion off of my Mac?

    gmiller0 wrote:
    My mac has 10.7.3 and will not connect to wifi after it wakes up. Have contacted AppleCare but the problem cannot seem to be resolved.. I guess this is a major issue with Lion:(
    What model of Mac?  I have a MBP running 10.7.3 and do not have that issue.  From the other couple of posts I've seen about it, it seems to be maybe an issue with some iMacs?  Have your tried searching the Lion or iMac forums for similar issues, just to see if anyone has hit on why it is happening?

  • HT201210 before updating ios7 my husband forgot to take backup with i tune. how can i get my old data

    before updating ios7 my husband forgot to take backup with i tune. how can i get my old data

    he was backing up the data in i tune but computer got switch off. if i go to start and apps data i can see some data was restored , but i dont know how transfer it to my i phone

  • On my windows 8.1 pc (i5 processor with 8GB ram) I can't get the automatic update voor CS4 master collection. I removed my panda antivirus and still can't automatically update. somebody any suggestion?

    on my windows 8.1 pc (i5 processor with 8GB ram) I can't get the automatic update voor CS4 master collection. I removed my panda antivirus and still can't automatically update. somebody any suggestion?

    thanks for your reply.
    in Dutch it says that there are no updates available. I know that after
    installing cs4 there are updates but i can't load them automatically. I did
    a delete and reinstall, but still get the message.
    kind regards,
    2014-09-23 16:28 GMT+02:00 Atul_saini123 <[email protected]>:
        on my windows 8.1 pc (i5 processor with 8GB ram) I can't get the
    automatic update voor CS4 master collection. I removed my panda antivirus
    and still can't automatically update. somebody any suggestion?  created
    by Atul_saini123 <https://forums.adobe.com/people/Atul_saini123> in *Downloading,
    Installing, Setting Up* - View the full discussion
    <https://forums.adobe.com/message/6755843#6755843>

  • I am trying to setup wireless using my old dome Airport ExtremeBase station. I had previously used it about 5 years ago when I had dial up but have now switche to DSL with Windstream. I can not get connecte as ABS keeps trying to dial up(the phone number)

    I am trying to setup wireless using my old dome Airport Extreme Base station. I had previously used it about 5 years ago when I had dial up but have now switched to DSL with Windstream. I can not get connected as the ABS keeps trying to dial up(the old phone number). When I tried to change my network settings an annoying popup window says "your network settings have been changed by another application'. I have no idea what the message is all about and when I close this window it immediately pops up again and prevents me -as far as I can tell -from changing my Airport settings?  I need advice on how to get this wireless setup done. Maybe a reset? or something else? I have the DSL phone line plugged into WIndsteam Seimens Speedstream 4200 modem and then the ethernet (yellow) wire from the WIndsteam Seimens Speedstream 4200 modem to the port on the dome that is a circle of dots.

    1)Can you explain how using the AEBS as a bridge will work with the Seimens Speedstream4200?
    As a bridge, the AEBS will basically become a wireless access point. This will allow the AEBS to provide a wireless network, but still allow the Speedstream to provide NAT & DHCP services for the wireless clients connected to the AEBS. If the AEBS was left as a router, you would have a double-NAT condition which isn't necessary bad in itself, but would create a second subnet. That would make it more difficult for clients connected to the AEBS to access clients connected to the Speedstream.
    2) Is there a link that will guide me through the steps to set the AEBS as a bridge?
    You can easily reconfigure the AEBS as a bridge using the AirPort Utility.
    ref: AirPort Utility > Select the AEBS > Manual Setup > Internet > Internet Connection > Connection Sharing = Off (Bridge Mode)
    3)Can I just connect the DSL phone line to the AEBS and eliminate the Speedstream4200?
    Unfortunately no. The AEBS does not have a built-in DSL modem. You will still need the Speedstream to provide this function.

  • I have a toshiba lap top computer with vista and I can not get my iphone to connect all the way .. it says "connected with limited activity"?

    I have a toshiba lap top computer with vista and I can not get my new iphone to connect all the way .... it says "connected with limited activity". which means I don't get on. Any help would be appreciated. Thanks.  

    Hi all,
    Guess I understand what is going on as I'm also experiencing the problem.
    Basically the issue is about the iPhone 4's personal hotspot.
    I'm trying to hook on personal hotspot to my toshiba laptop but it couldnt work as the connection is limited to local only without Internet access.
    The hotspot works well on other laptop and I-devices, but not my toshiba...
    Hope to get assistance here. Thanks

  • There is a particularly intrusive BMW app advert that pops up when playing Words with Friends that I can't get rid of.  There doesn't appear to be an exit option (most unethical). Any suggestions on how to get rid of the advert out ther?

    There is a particularly intrusive BMW app advert that pops up when playing Words with Friends that I can't get rid of.  There is no exit option (most unethical).  Any solutions for getting rid of the advert out ther?

    Do a malware check with several malware scanning programs on the Windows computer.
    Please scan with all programs because each program detects different malware.
    All these programs have free versions.
    Make sure that you update each program to get the latest version of their databases before doing a scan.
    *Malwarebytes' Anti-Malware:<br>http://www.malwarebytes.org/mbam.php
    *AdwCleaner:<br>http://www.bleepingcomputer.com/download/adwcleaner/<br>http://www.softpedia.com/get/Antivirus/Removal-Tools/AdwCleaner.shtml
    *SuperAntispyware:<br>http://www.superantispyware.com/
    *Microsoft Safety Scanner:<br>http://www.microsoft.com/security/scanner/en-us/default.aspx
    *Windows Defender:<br>http://windows.microsoft.com/en-us/windows/using-defender
    *Spybot Search & Destroy:<br>http://www.safer-networking.org/en/index.html
    *Kasperky Free Security Scan:<br>http://www.kaspersky.com/security-scan
    You can also do a check for a rootkit infection with TDSSKiller.
    *Anti-rootkit utility TDSSKiller:<br>http://support.kaspersky.com/5350?el=88446
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

  • I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in

    I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio 2013?

    For MS Visio (any version) only the appropriate version of Acrobat *PRO* provides PDFMaker for Visio.
    For Visio 2013 specifically you must have Acrobat XI Pro (updated to at least 11.0.1).
    See: 
    http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html  
    Be well...

  • I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio

    I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio 2013?

    For MS Visio (any version) only the appropriate version of Acrobat *PRO* provides PDFMaker for Visio.
    For Visio 2013 specifically you must have Acrobat XI Pro (updated to at least 11.0.1).
    See: 
    http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html  
    Be well...

  • My iphone 3g is in reset mode and i tunes will not reset. it pops an error message with no code. how can i get i tunes to rest my phone?

    my iphone 3g is in reset mode and i tunes will not reset. it pops an error message with no code. how can i get i tunes to rest my phone?

    No need to Double Post... It is considered impolite.
    https://discussions.apple.com/message/20652820#20652820

Maybe you are looking for

  • How do I convert a pdf or Word document into a fillable form?

    I have a questionnaire that I created in Word and have saved as a pdf.  I would like to email and post this form on a web page for my clients to complete.  How do I accomplish this?

  • Trying to display a result set in a jsp page

    While trying to do that, i get this exception org.apache.jasper.JasperException: An exception occurred processing JSP page /tablasUF.jsp at line 17 14: 15: Connection con = src.Connect.connectMe(); 16: 17: Statement statement = con.createStatement()

  • How to change file type to application mapping

    I switched from OpenOffice to iWork. Now when I double click a file with an extension .doc or .xls, still OpenOffice opens by default. I would rather have the defaults set to iWork, but without completely removing OpenOffice (yet). How can I accompli

  • Automator to scan images using Twain into Photoshop CS

    Hi, I Need to scan about 500 certificates to my hard drive. I have Photoshop CS and Epson 1650 scanner. What I would like to do it to be able to run an automate task from Photoshop that scans, imports and opens the certificate. To import at the momen

  • File info camera data1

    Hello, I am using CS3 and win XP. Camera is Nikon D300. When I try to display the camera data to see the shutter speed and aperture value fields are blank. Any ideas why? Thanks, Steve.