Mailing Lists: Apple Mailing Lists

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

Re: More on the Audio Only Canvas requirement....



Are u saying u need a canvas to say play a aiff file? Just to be clear?

You want to play an audio file? Not a movie, and u are saying u need a
QTCanvas to do that? Narr u don9t:

// just play an audio file
QTPlayer aup;

public void playAduioFile(String fileName) {
try {
QTSession.open(); // open a QTSession
// loads a sound file from the hard-drive.
// the sound file can be any qt file format.
aup = (QTPlayer)QTFactory.makeDrawable(new QTFile("tune.aiff"));
// set the playback rate/speed.
aup.setRate(1f);
// the important bit. Without this your player wont run
// for more the a few seconds. This is the player thread.
aup.startTasking();
} catch (Exception ex) {
ex.printStackTrace();
}
}

And there u have it.. U don9t need a QTCanvas at all :)

Hope that helps. I find the QTPlayer a lot better then any of the other
players in QuickTime.


Tops


aNt

> Actually the possible bug I described in my earlier post is more serious
> that I had originally thought.
> I was willing to accept the fact that you had to have an on screen QTCanvas
> in order to play audio only files. However, my application is a lightweight
> app and hence I use a JQTCanvas instead. However, QT throws a bunch of
> errors when setting the JQTCanvas objects client to a MoviePlayer that has
> nothing but Audio (See stack trace). This is the same "PlayMovie" example
> but with the QTCanvas object changed to a JQTCanvas (and the frame to a
> JFrame of course).
>
> So now whats my solution. I need a canvas to play the audio, but can't
> create a canvas for audio only???
>
> Any thoughts any one?
>
> quicktime.qd.QDException[QTJava:6.0.0g2],-50=paramErr,QT.vers:6028000
> at quicktime.qd.QDException.checkError(QDException.java:38)
> at quicktime.qd.QDGraphics.allocate(QDGraphics.java:429)
> at quicktime.qd.QDGraphics.<init>(QDGraphics.java:418)
> at quicktime.qd.QDGraphics.<init>(QDGraphics.java:370)
> at
> quicktime.app.image.QTImageProducer.<init>(QTImageProducer.java:77)
> at quicktime.app.display.JQTCanvas.doSetClient(JQTCanvas.java:270)
> at quicktime.app.display.JQTCanvas.setClient(JQTCanvas.java:188)
> at PlayMovie.createNewMovieFromURL(PlayMovie.java)
> at PlayMovie.<init>(PlayMovie.java)
> at PlayMovie.main(PlayMovie.java)
>
>
>
> Noel Murphy
_______________________________________________
quicktime-java mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/quicktime-java
Do not post admin requests to the list. They will be ignored.

References: 
 >More on the Audio Only Canvas requirement.... (From: "Noel Murphy" <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.