Playing sound using quicktime package?

I'm trying to make a very simple program (actually, part of a much larger program) that can play a sound file. Nothing else needs to happen during that time, and no other sound file will be played at the same time, so hopefully I'll be able to avoid threads, mixers, and all the rest of that stuff.
After not being able to make head or tails of all the extremely complicated tutorials on Java Sound, I finally found some very short code that allows me to play a .wav file, just like I'd want. My only concern is that it uses the quicktime package, instead of the Sound package that everyone else seems to refer to.
In particular, it seems to be treating the sound file like a movie. Here's some source code:
import quicktime.*;
import quicktime.io.*;
import quicktime.app.time.*;
import quicktime.app.view.*;
import quicktime.std.movies.*;
import quicktime.std.*;
// Lots of GUI interface stuff
    public void playFile (String fileName) {
         try {
            String soundLocation = QTFactory.findAbsolutePath(fileName).getPath();
            OpenMovieFile fileIn = OpenMovieFile.asRead (new QTFile(soundLocation));
            movie = Movie.fromFile (fileIn);
            TaskAllMovies.addMovieAndStart();
            movie.setActive(true);
            movie.setRate(1);
           } catch (IOException ioe) {
                ioe.printStackTrace();
           } catch (QTException qte) {
                qte.printStackTrace();
    }Does this seem to be all ok? Will the computer the program is running on need QuickTime, or is that completely different? Is this as fast as using Java Sound?
Sorry for the possibly silly questions. Normally I'd say "I've tested it, it works, so that's all I need", but I got a little bit worried seeing "quicktime" and "movie", and wondered if this is what I really should be using.
Thanks!

Also-- something to think about. You may be able to
avoid threads while the song is playing-- if you
never want to stop it, pause it, or do *anything
else* within the same GUI -- assuming you're using a
GUI.
Hope something in the above helps.In this program the user doesn't get to control the sound while it is playing. The program is an assesment of language comprehension engine for my lab. The user hits "Go", the sound plays (all 2-3 seconds of it), then the user hits "yes" or "no" depending on the sound.
I'm only just starting to code this. Do you think it's going to need threading? I can't imagine that it ought to take more than 5-10 lines of code, but those Sound tutorials made it seem like I'd need 100.
As for playing a "movie", that's why I was worried. Taking a deeper look, it seems like Apple's Developer website is promoting using the QuickTime package, but I haven't yet worked out how compatible it is with other file systems, and whether it's as good.
Thanks, and any other thoughts are welcome!
--Sam                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • No Sound using Quicktime

    I am using an iMac G5, 10.4.8, with Quicktime 7.1.3 and for some reason I cannot hear any quicktime movies played. The video portion works fine, just not the sound. I've gone into all of the sound system files and my microphone and speakers work fine with other software. The problem seems to only be in the Quicktime play back.
    I also cannot hear any sound with the Quicktime plug-in.
    Can anyone offer suggestions? Thanks.
    jbairport

    After still no success with your suggestion, I continued my search and went to:
    http://www.macfixit.com/article.php?story=20070312102605199
    There, I found the fix that worked for me. It was the following: "No sound after update -- fix If you are having issues with sound not playing in QuickTime content after the update to QuickTime 7.1.5, try launching then quitting GarageBand, or launching then quitting the "Audio MIDI Setup" application located in Applications/Utilities."
    I did both, and one of them fixed my problem. I now have sound with Quicktme 7.1.5 once again. I am very happy! Thanks again for the suggestion and the help.
    jbairport

  • No sound using quicktime 7 and 10

    Hi guys,
    I've got 2 MBP, on my old one I run Snow Leopard, on my new one (just bought 2 weeks ago) 2.5Ghz 4Gb ram (high-end product) the "freakin" Lion.
    I just can't believe so many issues happened to me... Furious!!!
    I experiences several problems to be able to use FCP 7 "voice over recorder's tool" normally, multiples crashes under numbers of app, and now just found out something new: a mp4 file recorded on my GOpro HD which can be played with sound on Snow leopard without any issues, this same file happen to
    crash almost everytime I run it on Lion, and when it comes to be readable, it is ONLY playing video... NO SOUND at all!
    Does anyone know how to solve this problem?
    Thanks

    After still no success with your suggestion, I continued my search and went to:
    http://www.macfixit.com/article.php?story=20070312102605199
    There, I found the fix that worked for me. It was the following: "No sound after update -- fix If you are having issues with sound not playing in QuickTime content after the update to QuickTime 7.1.5, try launching then quitting GarageBand, or launching then quitting the "Audio MIDI Setup" application located in Applications/Utilities."
    I did both, and one of them fixed my problem. I now have sound with Quicktme 7.1.5 once again. I am very happy! Thanks again for the suggestion and the help.
    jbairport

  • Play sound using web.show document

    Does anyone know if web.show_document can be used to play a .wav without displaying the media player on the screen ?

    INteresting thread, one other thing to mention is that while we are opening up Forms to the Java world, we are infact trying to maintain the 4GL pl/SQL interface we know that the Forms developers like.
    So for example, while we introduced PJC and Java Beans in earlier releases, in subsequent releases we have added packaged (FBEAN) to protect you from the nuts and bolts of Java.
    Sure, if you are writing PJC and Beans then you may already have taken the jump into the Java world but equally it could be one of the "new kids" who have grown up with Java who are writing these and all the experienced "old timers" plug it into Forms ;o) [without having to get too wet in the java pond).
    Grant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Rollover buttons to play sound using "loadSound"

    Hi, there
    I am seeking help with the following AS2 code. The target effect: Rolling over each of the two buttons on the main stage plays different sound. The code below works. However, I need to embed it in another application (Articulate) which doesnot allow the use of "_root" and "attachSound". I was recommended to use "loadSound" instead. However, not a coding person, I am at a loss.
    Can anyone help me to change the script below to remove "_root" and "attachSound" and use "loadSound" instead? Thanks so much!
    var mySound:Sound = new Sound();
    mcButton5.onRollOver = function() {
    _root.mySound.attachSound("sound1");
    _root.mySound.start();
    var mySound:Sound = new Sound();
    mcButton6.onRollOver = function() {
    _root.mySound.attachSound("sound2");
    _root.mySound.start();

    I finally got it work, using load Sound...
    Kglad, thanks for your great help, as always!
    mySound1 = new Sound();
    mySound1.loadSound("Sound1.mp3", false);
    mcButton1.onRollOver = function() {
    mySound1.start();
    mcButton1.onRollOut = function() {
    mySound1.stop();

  • Playing sound using ActionScript 3.0 (newbie)

    I have a Flash animation I've created, and at the last minute we have decided to add one audio track to the background.  The problem is, I have a looping animation in the timeline, so simply inserting the audio into a layer in the timeline will not work (because it will loop as well).
    Can anyone help me with how to insert just one sound file "on top" of all the animations playing using ActionScript 3.0?  I've never worked with the Sound class, and have never put audio into a Flash file besides simply importing it into a frame.
    THANKS!
    Jen

    Worked perfectly.  Thank you thank you!
    Jen

  • Youtube videos wont play after using Quicktime (which changed my preferenaces) how to fix?

    I played a video in Quicktime on my pc (against my better judgement). Quicktime went through my FF & changed everything to be played in QT, now online videos, specificallt Youtube, wont play in my FF browser (3.6.14).
    I get sound but no picture.
    What do i change back to fix this?I have changed everything to either WMP or VLC to try & get it to play with no luck so i must be missing something?

    I had this problem and searched it and came up with a solution that works for me.
    First, I only started having this problem for the last few days, this came after a multitude of updates from Adobe and Windows.
    The videos would only play (though the sound kept playing) if I kept moving the mouse cursor over the video.
    My solution, I went into Tools \ Options \ Advanced \ Network ... and simply cleared the Cache Web Content. I might have also deselected Override Automatic Cache Management ... but regardless, this is the solution that is still working for me.
    I should also add that when FireFox gets flaky that's where I always go and that seems to solve any strangeness. Just passing this on.
    EDIT ---- Just now I experienced the same thing. I obviously did not fix this issue. Sorry for this unnecessary post.

  • Certain .AVI files will not play audio using QuickTime 7.5

    I have recently updated my QuickTime to QuickTime Pro 7.5. I attempted to play videos in my library and noticed that certain videos will not play the audio, but video is fine. I did not have problems with playing the videos with audio before the update.
    I tried to do some research and many have suggested to install PERIAN 1.1. I have done this, but still no result. I have deleted a lot of important videos, because I assumed that they are no longer usable. I decided to keep most of them and figure out a solution. No luck so far.
    Please help! Anyone else experiencing this problem?

    I'm not really sure what to look for in QT's Movie Inspector, but here's what it says:
    Format: Apple OpenDML JPEG, 320 x 240, Millions
    FPS: 14.99
    Playing FPS: (Available while playing.)
    Data Size: 11.96 MB
    Data Rate: 2112.38 kbits/s
    Current Time: 0:00:00:13.94
    Duration: 0:00:00:47.50
    Normal Size: 320 x 240 pixels
    Current Size: 320 x 240 pixels (Actual)
    If Pro update were not suited for Intel Mac's, should I uninstall the update? If so, how do I do this? Do you have any other suggestions?
    Thanks again for the reply!

  • How to play MP3s on IPhone without using QuickTime

    I listen to a lot of audio lectures that come in an email with a direct link. My phone will automatically open these and play them using QuickTime, but QT doesn't have an option to bookmark. I don't typically finish the full lecture in one sitting so I need to be able to bookmark my place. iTunes will not work for me for this as I am not always able to take the several extra steps necessary to download to my computer and then wait for them to show up on my phone through icloud which sometimes takes days. Always hours. Is there another app that will do this?  Audible is a good example of how I would like it to work.

    Yes I have, thank you.  And google. 

  • Getting beach balls on some videos using Quicktime X with Perian

    Hi, Some of my videos play perfectly using Quicktime X with Perian and with others I get the spinning beach balls. These videos seem to play fine when using VLC. Is this normal? Thanks

    Is this normal?
    It could be. The "spinning ball" indicates the application is "busy" -- i.e., actively involved in some activity. QT is very touchy about things like timecode breaks and proper file terminations. In some cases, like "muxed" MPEG-2 content, the QT player actually has to trace the data stream from beginning to end before playback will begin. VLC, on the other hand, containes its own codecs and is geared to Windows specific contetnt types which may not rely on external time references like QT or whose data may be open-ended or contain numerous timecode breaks. Additional delays may be caused by continuous switching between 32- and 64-bit modes of operation and/or other complications/problems.

  • I upgraded to mavericks About a month ago, Every since I have had pops and static when playing anything through quicktime nd when playing sound cloud through Safari. I am using a presonus Firestudio interface. What can i do to correct this?

    Hey all,
              About a month ago I upgraded to mavericks on my 2009 imac. I am using a presonus firestudio interface. Every since quicktime will not play without massive static, It gets better when I change to 48,000 but still there. also safari will not play music or videos that use quicktime. How can i solve this or go back to mountain lion which worked flawlessly.

    Hey all,
              About a month ago I upgraded to mavericks on my 2009 imac. I am using a presonus firestudio interface. Every since quicktime will not play without massive static, It gets better when I change to 48,000 but still there. also safari will not play music or videos that use quicktime. How can i solve this or go back to mountain lion which worked flawlessly.

  • Embedded QuickTime files not playing sound

    I'm having trouble getting older, embedded QuickTime files to play properly. Many of them do play but without sound.
    An example:
    The embedded QuickTime files in questions 6 and 10 here...
    http://www.linguistics.ucla.edu/people/schuh/lx001/Web_Quizzes/Quiz_07/07web.htm l
    ...do not play sound.
    When viewing the files directly...
    Example: http://www.linguistics.ucla.edu/people/schuh/lx001/Web_Quizzes/Quiz_07/07_Quiz_m edia/0706_split_brain_red.mov
    ...the sound plays properly.
    I have done a bit of playing around on a few different machines and have found the following:
    2009 MacBook Pro: video and sound play correctly in Safari and Firefox
    OS X: 10.7.5
    Safari: 6.1.6
    Firefox: 36.0 with QuickTime Plugin ?
    QuickTime 7: ?
    QuickTime X:10.1
    2009 Mac Mini: video and sound play correctly in Safari and Firefox
    OS X: 10.8.5
    Safari: 6.2.3
    Firefox: 33.1 with QuickTime Plugin 7.7.1
    Firefox: 36.0.1 with QuickTime Plugin 7.7.1
    QuickTime 7: 7.6.6
    QuickTime X: 10.2
    2011 Mac Mini:  video and sound play correctly in Safari and Firefox
    OS X: 10.9.5
    Safari: 7.1.3
    Firefox: 31.0 with QuickTime Plugin 7.7.1
    Firefox: 36.0.1. With QuickTime Plugin 7.7.3
    QuickTime 7: 7.6.6
    QuickTime X: 10.3
    2011 iMac: no sound in videos, improper display of video with menu in both Safari and Firefox
    OS X: 10.10.2
    Safari: 8.0.3
    Firefox: 36.0.1 with QuickTime Plugin 7.7.3
    QuickTime 7: 7.6.6
    QuickTime X: 10.4
    2011 Mac Pro: no sound in videos, improper display of video with menu in both Safari and Firefox
    OS X: 10.10.2
    Safari: 8.0.3
    Firefox: 36.0.1 with QuickTime Plugin 7.7.3
    QuickTime 7: 7.6.6
    QuickTime X: 10.4
    Is this a Yosemite issue? Not being able to play older QuickTime 7 files properly? I'm not sure what else the issue could be since everything seems to work fine in 10.7, 10.8, and 10.9 (unfortunately, I have been unable to test this in 10.10 or 10.10.1). Maybe I'm overcomplicating a simple issue? Any help would be greatly appreciated.
    Thanks!

    Is this a Yosemite issue? Not being able to play older QuickTime 7 files properly? I'm not sure what else the issue could be since everything seems to work fine in 10.7, 10.8, and 10.9 (unfortunately, I have been unable to test this in 10.10 or 10.10.1). Maybe I'm overcomplicating a simple issue? Any help would be greatly appreciated.
    Some very interesting observations which peaked my own curiosity due to on-again, off-again nature of the playback. I suspect this is either a "bug" or represents content handling changes that are currently in the process of  "evolving." Not a web site programmer so I used iWeb to run some contrast-comparison tests on how audio was handled by the plug-in software when directly accessing the content by its URL and via the page embed strategies. My results mirrored yours in that:
    1) All legacy codecs tested (A-Law, IMA, QDM2, QPV, and u-Law) in an MOV file container played correctly in the QT 7 player.
    2) The same files all played correctly when content was accessed by the plug-in software directly using the URL reference.
    3) None of the files containing legacy audio compression formats would play audio using the plug-in software using a web page embedding strategy.
    4) An MP4 (H.264/AAC) version of you original clip played correctly in all instances.
    5) Replacing your QDM2 audio track with an AAC audio track in the original MOV file allowed the file to play correctly in all instances.
    Based on these observations, I suspect the problem is in the way the software is currently programmed to handle (or rather ignore) the embedded strategy content. However, as you indicated, it is probably time to update your files. Not only did the H.264/AAC version of your original file play in all instances, but it used less than 45% of the file space/bandwidth for the settings I employed as compared to your original "0706_split_brain_red.mov" original file.

  • Mpeg to Mpeg-4 using Quicktime Pro!!! No sound!

    Ok...I exported my mpeg file to movie to Ipod using Quicktime and it worked and then I dragged it to Itunes...but there's NO sound!! When I play it on Itunes or on my Ipod there is no sound!! PLEASE HELP!!!

    There certainly are some apps for Windows that will convert Mpegs and .wmvs, I was (and still am occasionally) a Windows user but I've never done video on it so I don't know them ...
    The .avi is just a contender, which usually contains DivX video. Do you have codecs for this format on your computer ( http://www.divx.com/ ) ? Once you have them, QuickTime should be able to play and export many .avi files to h.264 iPod-optimized video. Of course some .avi files contain video in an odd format for which you will have to get a codec I guess.

  • Quicktime movies playing sound with no picture (only in firefox)

    Hi There,
    I'm having a weird issue with quicktime in firefox on apple macs. I'm not really familiar with macs and I was wondering if someone can offer a solution? When I visit the page in firefox on a mac the video plays sound but not the picture. This seems to happen to all firefox browsers that I have tested.
    I have a test link here for people to look at. http://www.wellcom.net.au/quicktime.aspx

    To Apple Discussions!
    Thank you for providing the link for others to test for you. A got a flash video which I had no problem viewing with sound. The picture did take a few seconds to appear. However, the sound came in right away. Here is the direct video link: http://www.wellcom.net.au/images/movingimages/BookCity.mp4
    Picture & sound was instant from the .mp4 link.
    Make sure you have the latest versions of Adobe Flash Player Software, repair permissions & restart your computer.
    If the above does not work, then please advise which version of FireFox you are using?

  • So my I phone 4s volume has decided to pack  allowing only my phone to make sounds when I have an incoming call, I can also here fine using facetime and receiving calls. YouTube, soundcloud, any of I players will no longer play sound. I've restored the ph

    So my I phone 4s volume has decided to pack  allowing only my phone to make sounds when I have an incoming call, I can also here fine using facetime and receiving calls. YouTube, soundcloud, any of I players will no longer play sound. I've restored the phone using iTunes on my laptop and checked all the volumes are turned up and the button at the left hand Side of the phone is in the correct position.

    Try inserting and re-inserting your headphones 7 or 8 times. Also try cleaning out the headphone jack in case of debris that might be interfering with the connection/disconnection.

Maybe you are looking for

  • Erasing All - Install Disc Uncooperative

    I need to return my MacBook Pro to my previous employer and want to erase everything before doing so. Unfortunately, the install disc that came with it is allowing me to clean install. Every time I load the disc and hold down "c," it starts to boot,

  • Multiple drop down menus in a row

    I am trying to create a bid sheet for my interior design business. For example in my first column(A) i would like to have a drop down menu with Demo, Plumbing, Electric, etc.... and if i would select Pluming in that drop down menu, next to it in colu

  • Question regarding Command pattern

    Hi! I have a question regarding the Command pattern: //Invoker as defined in GOF Design Patterns public class SomeServer {     //Receiver as defined in GOF Design Patterns.     private Receiver receiver;     //Request from a network client.     publi

  • Backup failed while trying to take the managed metadata database using SSMS

    hi,  i am trying to take a backup of my  databaase - sharepoint managed metadata database . but i am getting the error, backup failed! Pls help, how to resolve this here is the screen shot.

  • IWeb won't open-cannot find "index.xml" file

    I've been having kernel panics lately and ran off my hard drive to another Mac (iMac) -not using migration assistant-and upon returning back to my main computer (MacBook Pro) and after diligently saving my Domain file, iWeb won't open because it cann