Problem in playing bg sound ?

in my app write a code in document class and inside of movieclip.Each movieClip is my category button in wich i am showing animal pics and voice in each frame. So i also code for BG sound playing in document class it works but whenever i click my category button and particular category is open my bg sound stop.
i also check my code i used SoundMixer.stopAll(); so tellme this the reason of my problem.

Most likely. stopAll(); will stop all sounds that are playing regardless of the way that each sound is controlled. If you want to have individual control over each sound then you should create sound objects for each and play each of these sounds in an individual sound channel. Then you can stop, start, pause, and change the volume of each sound.

Similar Messages

  • Problem with playing a sound file.

    Hi,
    I simply want to play a sound by a button click. I imported
    <AVFoundation/AVAudioPlayer.h>. The code block is here:
    In .h file:
    #import <UIKit/UIKit.h>
    #import <AVFoundation/AVAudioPlayer.h>
    @interface PlaySoundViewController : UIViewController <AVAudioPlayerDelegate>
    in .m file:
    -(IBAction)btnPlay:(id)sender
        //Get the filename of the sound file:
        NSString *path = [[NSBundle mainBundle] pathForResource:@"REC001" ofType:@"MP3"];
        AVAudioPlayer* thePlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];//error here as it will compile if I commented it (and two line after) out.
        thePlayer.delegate = self;
        [thePlayer play];   
    Everything looks fine but it failed when I tried to run it. Looks like it cannot find my sound file "REC001.MP3". I put it in folder ".../PlaySound/Resource Files/SoundFiles/REC001.MP3", and "PlaySound" is my project name. However the path returned is ".../PlaySound/REC001.MP3". I guess this is why it cannot find the object. But it didn't work even I put the sound file under "PlaySound" directly. Anyone has a solution?
    Thanks.
    Regards,
    Taizhi

    Hi Mark,
    Thanks for the reply. Based on your instruction, I checked and I can see the sound files in Build Phases. The location is ".../PlaySound/SoundFiles/REC001.MP3". I don't know why it ignores folder "Resource Files". I guess that is the way it is as I also can see other images in different folders which are shown properly in the project.
    The detailed error message is here:
    Ld "/Users/greatzhi2001/Library/Developer/Xcode/DerivedData/PlaySound-anydnuuxbpxz lqfodwbuqqjwjzcd/Build/Products/Debug-iphonesimulator/PlaySound.app/PlaySound" normal i386
        cd "/Users/greatzhi2001/Desktop/iProjects/PlaySound"
        setenv MACOSX_DEPLOYMENT_TARGET 10.6
        setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr /bin:/usr/bin:/bin:/usr/sbin:/sbin"
        /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3 .sdk -L/Users/greatzhi2001/Library/Developer/Xcode/DerivedData/PlaySound-anydnuuxbpx zlqfodwbuqqjwjzcd/Build/Products/Debug-iphonesimulator -F/Users/greatzhi2001/Library/Developer/Xcode/DerivedData/PlaySound-anydnuuxbpx zlqfodwbuqqjwjzcd/Build/Products/Debug-iphonesimulator "-F/Users/greatzhi2001/Desktop/iProjects/PlaySound" -filelist "/Users/greatzhi2001/Library/Developer/Xcode/DerivedData/PlaySound-anydnuuxbpxz lqfodwbuqqjwjzcd/Build/Intermediates/PlaySound.build/Debug-iphonesimulator/PlayS ound.build/Objects-normal/i386/PlaySound.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework UIKit -framework Foundation -framework CoreGraphics -o "/Users/greatzhi2001/Library/Developer/Xcode/DerivedData/PlaySound-anydnuuxbpxz lqfodwbuqqjwjzcd/Build/Products/Debug-iphonesimulator/PlaySound.app/PlaySound"
    Undefined symbols for architecture i386:
      "_OBJC_CLASS_$_AVAudioPlayer", referenced from:
          objc-class-ref in PlaySoundViewController.o
    ld: symbol(s) not found for architecture i386
    collect2: ld returned 1 exit status
    Is the framework AVFoundation I added wrong? Thanks.
    Regards,
    Taizhi

  • Problem, trying to play many sound files

    hello,
    I did not find a specific answer to my question in most of the archives and so I am posting here.
    my problem is that I have to play a sound when mouse moves over an object and another sound when the same object is clicked.
    there are many such items on the screen and so it is expected that when the mouse entered from the mouse listener is fired, the sound must play.
    but what really happens is that when the mouse moves over the first object the sound plays all right. but there is no sound played when the mouse click happens.
    I have properly loaded the sound files and I am sure that the code is right.
    infact the major thing that has frustrated me is that if I move the mouse on an opject (an icon) the sound is properly played. and if I wait for a long time and then move the mouse on another icon the other sound is played as well. but if I move the mouse quickly from one object to another no sound is played for the second object. or if I click the mouse on an icon after a long holt even the click sound playes.
    what could be the problem. why is it that sound only play when the actions are done after long haults?
    is it an issue of java performance. should I try to do the sound playing stuff in different threads for each icon's mouse events?
    I also tried to stop the file on the mouse exit method to make sure that there is no sound left playing.
    this game is depending a lot on mouse movements with sounds and so I have to get the sounds playing at the same time mouse moves over the objects.
    I use the audioClip to load my sounds with the method in the applet class.
    I really don't know abt the latest java media api and will like to know if that is what I must use for my task or audioClip is ok with me.
    thanks
    Krishnakant.

    I dont know exactly, but I dont know if applets support various files at one time.
    Have your tried to do that with javax.media or with javax.sound.sampled?
    Or could your post the code?
    R. Hollenstein

  • I have problem with playing stream  fullscreen. it goes black but with sound

    i have problem with playing stream fullscreen. it goes black but with sound. i have to wait 10-15 minutes then i can press fullscreen. what to do?
    s

    Thanks!! but i been fixing now for 10 minute ago by restart my macbook pro. My case is it show normal with Intenal-speakers and nothing mark with red light or mult so i tried to restart that it working again

  • I have a problem with the external sound of my ipod, when I take the headphones the music keeps playing and the ipod recognizes still have a headset connected. how do I get external sound out?

    I have a problem with the external sound of my iPod, when I take the headphones the music keeps playing and the ipod recognizes still have a headset connected. how do I get external sound out?

    - Try insering and removing the headphone plug a dozen times or so.
    - Try cleaning out the headphone jack in the iPod.
    - Resett he iPod. Nothing is lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Restore from backup
    - Restoe to factory defaults/new iPod
    If yu still have the problem that indicates a hardware problem, likely a bad headphone jack. Yu can make an appointment at the Genius Bar of an Apple store to confirm.
    If not underwarranty Apple will only exchange your iPod for a refurbished one for:
    Apple - Support - iPod - Repair pricing
    A third-party place like the following is less expensive. Here is one. Google for more.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens

  • Problem playing MIDI sounds

    I was wondering if anyone knows what I'm doing wrong. The code below plays a sound when the instrument is in bank 0 (for instruments in the array with index < 128) but not for bank 1 (with index >= 128). I can loop through and print out all the instruments, but can't play them all.
    Thanks for any help!
    MidiChannel[]     midiChannels = synth.getChannels();
    int nNoteNumber = 64; // 60 is Middle C
    int instNum = 165;
    int nVelocity = 100; // volume
    //Works fine - prints 188 instruments
    for (int j = 0; j < inst.length; j++)
         System.err.println("Instrument " + j + inst[j]);
    synth.loadInstrument(inst[instNum]);
    midiChannels[0].programChange(inst[instNum].getPatch().getBank(), inst[instNum].getPatch().getProgram());
    // Only works when instNum < 128
    midiChannels[0].noteOn(nNoteNumber, nVelocity);

    Hi
    I was having a similar problem. This method: MidiChannel.programChange(int bank).
    Well, you would think that passing in the bank here would work, wouldn't you? I notice that that's what you have done.
    But for some reason, in the sample code that comes with the API, I notice that they seem to pass in the instrument index in the array returned by getAvailableInstruments. I tried this and it worked.
    hth

  • What's the wave's number of iPhone 4S speakers? I need to know what's the number because my phone doesn't play any sounds, and I kind of knew what's the problem and sulotion!

    What's the wave's number of iPhone 4S speakers? I need to know what's the number because my phone doesn't play any sounds, and I kind of knew what's the problem and solution!
    What I mean by wave is like radio channels' waves! Ex. 104.1

    Your statement makes no sense.
    Have you tried basic troubleshooting from the User's Guide to rule out some setting in the device preventing the speaker from working?
    Is the mute switch on?
    Do other sounds work?
    Does it produce sound with headphones plugged in?

  • My media player is not working, no sound. keeps saying encountered problem while playing the file.

    HP Pavilion g series (g6-1b50us Notebook PC), windows 7, 64-bit.
    My media player keeps saying  it encountered problems while playing a file. and little red x's appearing beside song titles. They did play before. Please help.

    Hi,
    This may happen if the files were moved to a different folder or a different location.
    Try this:
    http://answers.microsoft.com/en-us/windows/forum/windows_7-sound/red-x-symbol-next-to-each-song-whil...
    Note:
    If you have HP Support Assistant installed on the computer(The Blue Question Mark) then open it ==> Complete all pending Updates & Tuneups==> Restart and Check. It may solve your problem
    Although I am an HP employee, I am speaking for myself and not for HP.
    **Click on “Kudos” Star if you think this reply helped** Or Mark it as "Solved" if issue got fixed.

  • HT1349 My Ipod mini syncs, but when I go to play, no sound.  I've tried multiple speakers and headphones. No Go.  What next?

    My Ipod mini syncs, but when I go to play, no sound.  I've tried multiple speakers and headphones. No Go.  What next?
    My latest problem is that the Apple site will not recognize my equipment by it's serial number.  I know the mini is old, but I like what it did for me and don't necessarily want to "upgrade".

    This is the iPad in the Enterprise forum. You'll be more likely to get help with your issue if you ask in the appropriate iPod forum.
    Regards.

  • Problem with playing video via composite av cable on iPod classic 2009 model 160gb

    Things went well, after  purchasing the new Ipod classic 160 gb i tryied to watch movies on my LED TV via Composite AV Cable.  I did it once. Everything worked correctly & I was able to see my photoes, watch movies.  Today i tryied to connect it again to the TV via av composite cable. The TV Out was switched on. But i could hear only audio. No video. I tryied all possible configs for Ipod an for tv set & no result. If i choose on my Ipod to ask me  first if i want to switch on the AV out, the Ipod shows me a message that i should connect the video accessory (but it  is already connected!). If i choose simply to switch on the TV Out without asking  me it will play either sound only on the TV, either the playback on the Ipod is ending after 20 seconds of show time.
    Without AV Cable connected Ipod is working normaly in terms of video playback. Also the device is working normally with the ITunes.
    Please help. Where is the problem. The AV composite cable? TV set? Or iPod itself?

    Hi Rusbug,
    I am having the same issue with my iPod Classic 160gb not playing video on the TV via Composite cable as you posted in march!
    did you get a solution for the issue??
    desperate to know what to do next.
    thanks

  • Play a sound many times in a short time

    Hi,
    i am using JMF 2.1.1e, and i wondered if there was some trick to play a sound many times in a short time.
    The first method i used was:
         private static Thread t     = null;
         private static URL url;
         private static Player player;
         public static void playSound(String name)
              File mp3 = new File("./sounds/level5/"+name+".mp3");
              try { url = mp3.toURL(); } catch (MalformedURLException e) {e.printStackTrace();}
              // to prevent from multiple sounds playing at the same time
              if(t != null && !t.isInterrupted()) t.interrupt();
              t = new Thread()
                   public void run()
                        try
                             MediaLocator ml = new MediaLocator(url);
                             player = Manager.createPlayer(ml);
                             player.addControllerListener(
                                       new ControllerListener()
                                            public void controllerUpdate(ControllerEvent event)
                                                 if (event instanceof EndOfMediaEvent)
                                                      player.stop();
                                                      player.close();
                             player.realize();
                             player.start();
                        catch (Exception e) { System.out.println("Exception encountered!");}     
              t.start();
    I wasn't really satisfied with such a method, since it often took two or three seconds before the sound start playing (maybe because my pc is slow, and the method takes too much memory) so i came up with another idea : storing the sound , calling the "start" method each time i need them, and re-preparing them for the next call short after the call to start; it gives :
    static Player[] sounds = new Player[15];
    // first initialization of a sound
    sounds[0] = new Splay().generate("fac");
    // call to the sound, the sound plays nearly immediately
    sounds[0].start();
    // reinitialization of the sounds, in order to prepare him for the next call
    Splay.scheduleInit(0,"fac");
    // methods used:
    public static void scheduleInit(final int index, final String name) {
    new java.util.Timer ().schedule (new TimerTask () { public void run () {
         Screen.sounds[index] = new Splay().generate(name);
    }},500);
    // and
         public Player generate(String name) {
              Player p = null;
              File mp3 = new File("./sounds/level5/"+name+".mp3");
              try { url = mp3.toURL(); } catch (MalformedURLException e) {e.printStackTrace();}
              try {
                   MediaLocator ml = new MediaLocator(url);
                   p = Manager.createPlayer(ml);
                   p.realize();
              } catch (Exception e) { System.out.println("Exception !");}     
              return p;
    it works better than the first one, but it's still not perfect ;
    To resume, i need a code that easily allow to :
    - Launch tracks fast
    - Don't play many sounds in the same time (means that stops the currently played track before loading the new one)
    - A player that handle MP3 would be really better compared to a wav player
    Will be great if you have something like that
    Thank you very much ^^
    Message was edited by:
    calvino_ind

    You can follow the below steps to easily play a sound at runtime - like on mouseover.
    1. Make sure your audio is imported in library and has a linkage name specified.
    2. Open Windows Menu -> Code Snippets panel and expand HTML5 Canvas -> Event Handlers section.
    3. Select your button on Stage and apply the MouseOver Event from Code Snippets to it.
    4. In the MouseOverHandler function add the below line and test movie:
              playSound('audio_linkage_name');
    If you still face problems let me know.
    Also, you might want to go through the SoundJS documentation for more control with Audio in HTML5.

  • Macbook air won't play youtube sound

    yahoo videos play without problems, music plays, but I can't get any sound from youtube videos.  What could be the problem

    Go to Adobe.com and download the newest Flash update, then see what happens.

  • Lost the ability to play multiple sounds!

    Since switching to archlinux, the only problem that I am unable solve is the inablity to play multiple sounds.. i had this problem when i first installed archlinux. back then i tried installing pulseaudio and found that cumbersome. eventually went back to alsa and found magically i could play sounds at once..
    now again it has reoccurred ever since the module init tools upgrade. i have tried reconfiguring alsa with alsaconf with no avail.
    on trying to play sound file from the 2nd app i get a knotif saying
    The audio playback device HDA Intel (ALC880 Analog) does not work
    Falling back to .
    some of the conf files i have:
    [$]> grep MODULES /etc/rc.conf
    # MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
    # NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
    MODULES=(e100 mii slhc snd-hda-intel snd-mixer-oss snd-pcm-oss snd-hwdep snd-page-alloc snd-pcm snd-timer snd soundcore !snd-pcsp)
    [$]> grep DAEMONS /etc/rc.conf
    # DAEMONS
    DAEMONS=(syslog-ng dbus @network netfs crond alsa hal cups @openntpd)
    [$]> cat /etc/modprobe.d/modprobe.conf
    # /etc/modprobe.d/modprobe.conf (for v2.6 kernels)
    [$]> cat /etc/modprobe.d/sound.conf
    alias snd-card-0 snd-hda-intel
    alias sound-slot-0 snd-hda-intel
    [$]> cat /etc/libao.conf
    default_driver=alsa10
    [$]> lspci | grep -i audio
    00:1b.0 Audio device: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller (rev 03)

    djszapi wrote:It seems to good. Did you try pulseaudio now too ?
    no i dont want to. it doesn't seem right with kde

  • Airplay plays – without sound

    I am not sure if it is a iTunes, AppleTv, Airplay or Time Capsule issue – or a combination of them all.
    But i am experiencing alittle annoying issue, which i hope to fix.
    I am playing music from iTunes 11.0.5 and i Airplay it to my AppleTv it plays with sounds and all as it sould. But often we it continues to the next track, I can see it plays because the playcounter is running and it Scrobbles to Last.fm – but there is no sound. I then have to pause and press play, or skip back to beginning of the track. Otherwise it can continue to play the rest of the album, just without sound.
    I think it might have something to do with all the media files are stored on my Time Capsule, but the iTunes folder containing the .itdb and .itl are still on my local HD. It is as if it doesn't load the files properly. But i don't have any issues with movies files.
    Is it a iTunes Time Capsule issue? And if so, any fixes? I tried updating to latest firmware, but it didn't resolve the issue.
    Or could the problem be soemthing else?
    I do have a pretty fast internet connection both in upload and download.
    MacBook Pro 10.8.4
    iTunes 11.0.5
    AppleTv 2.gen (lastest OS)
    Time Capsule 4. gen. (7.6.4)

    Try using this application to convert the videos, or the instructions in this article.
    (15110)

  • Javascript doesn't play() embedded sound

    This is a question about the PDF specification regarding how to use the javascript API
    to play a sound object.
    Specifically, why in my basic example is the javascript able to see the sound,
    but can't play() it?
    I have a test PDF illustrating my problem at
    http://www.affexion.net/test/PDF/test-scriptsound.pdf
    This is a stripped down example.
    The sound is referenced from a simple annotation
    on the left. Double-clicking it plays the sound as expected.
    On the right is a button which when activated is supposed to
    execute a javascript.
    << /S /JavaScript /JS ( console.show(); try {this.sounds[0].play(); } catch(e) { console.println(e.toString()); } console.println(this.sounds[0].name); ) >>
    I see the console open up, and I see it print the name of the sound "mySound",
    but I don't get the sound played.
    Do I need to do something in my javascript before I call this.sounds[0].play?
    Is there some other mistake in the way I have the sound object embedded and referenced?
    Thanks very much for any help.

    In followup, I have been able to accomplish what I wanted:
    use an embedded javascript to play an embedded sound
    For future readers, my example is (temporarily) at:
    http://www.affexion.net/test/PDF/sound-by-script.pddf
    How I did it:
    interaction of 2 components, the script and the (named) sound
    The script object looks like:
    << /S /JavaScript
    /JS ( console.show\(\); var s=this.getSound\("mySound"\); s.play\(\); )
    >>
    The named sound "mySound"
    The catalog needs an entry pointing to a name dictionary, like:
    1 0 obj << /Type /Catalog /Names XX 0 R >> endobj
    The name dictionary has an entry /Sound like
    XX 0 obj << /Sound XY 0 R >> endobj
    Then the actual name mapping:
    XY 0 obj << /Names [ (0xFEFFmySound) XZ 0 R ] >> endobj
    With the sound object at:
    XZ 0 obj << /Type /Sound /Length NNNNN >> stream...endstream endobj
    Key point: the string object (0xFEFFmySound) needs to be unicode-16 encoded
    with the first 2 bytes being FEFF.
    That was a real pitfall for me.
    Now that whole setup actually works.
    Sadly, though - I looked all through the PDF specification and
    in section 7.7.4 Name Dictionary, I don't see any Sound key.
    If anyone could explain how that sequence of Name dictionary to
    sound name is described in the specification, I'd appreciate it.

Maybe you are looking for

  • Fields

    plshelp dear friends what are the tables and fields for folling data. open production order: plant no : material num : finished date : available stock : safety stock : quantity :

  • X200 does not turn on

    Problem: Laptop tries to turns on only when battery is inserted, but only LEDs flash once. When battery is removed, laptop does not trying to turns on, and the LED 'AC power status' does not illuminate (but it must illuminates) This happend when I re

  • Putting method in graphic window instead of console

    Hello! I want my blackjack game to run in a graphical window instead of in the console. I have already made 2 buttons that starts the method(the blackjack game) and that shuts down the program. But when the program starts the text is printed in the c

  • Speakers for the iPod running on batt, do they cut battery use in half?

    I know that volume has a lot to do with battery drain on a battery radio, and I imagine it is the same with the iPod. How much drain do speakers (the kind specifically made for the iPod) cause? Do they cut the battery useful time down to 2 hours? 1 h

  • How to package an obfuscated swf ?

    I'm not sure how the packager works but it seems to create a new release build and then package it. Then, how can I package my own swf file after having it obfuscated ? There is no way to just browse for the swf file I want to have included. Thanks i