Manager.createPlayer () to play a tone beginning of app

Hi, I've been doing securityexceptions and finally understood that he had

try
{
        p1 = Manager.createPlayer("file:///" + theFile);
        p1.realize();
        vc = getVolumeControl(p1);
vc.setLevel(Integer.parseInt(volumeChoiceField.getChoice(volumeChoiceField.getSelectedIndex()).toString()) * 10);
        p1.prefetch();
        p1.setLoopCount(-1);
        p1.start();
}
catch (IOException ex)
{
        UiApplication.getApplication().requestForeground();
}
catch (MediaException e)
{
    e.printStackTrace();
        UiApplication.getApplication().requestForeground();
}

If I start playing the tone when the user clicks the button, it will start without problem. However, I'm starting to play a sound when the application starts and it is then securityexception appears.

Help, please!

It turns out that this 3rd party cannot play tones of the sample system

http://supportforums.BlackBerry.com/T5/Java-development/security-exception-while-playing-preloaded-s...

This is the second time I have answered my own question. Sorry guys, I'll make sure to search more before I post questions here promise!

Tags: BlackBerry Developers

Similar Questions

  • Problem with Manager.createPlayer)

    Hello

    I want to play a little mp3 noise when I turn on my BB with a background application. So first, I tried this code in a foreground application:

        public void play()      {        //first we need to find the supported content types        String types[] = Manager.getSupportedContentTypes(null);        for (int cnt = types.length - 1; cnt >= 0; --cnt) {            if (types[cnt].equals("audio/mpeg")) {            //this sample demonstrates playing an MP3 file that has been             //added as a resource to the project            try {                //retrieve the MP3 file                Class clazz = getClass();                InputStream is = clazz.getResourceAsStream("/test.mp3");                //create an instance of the player from the InputStream                Player player = Manager.createPlayer(is, "audio/mpeg");                player.realize();                player.prefetch();                //start the player                player.start();                } catch (Exception ex) { System.out.println("ERROR -> "+ex); }             }         }    }
    

    But it does not work! It returns the exception "java.lang.IllegalArgumentException: flow: null". I think that it does not find test.mp3. I put the mp3 file in the same directory the files .java and .jdp.

    So, could you tell me what I have to add or delete of this code, listen to this sound (first in a foreground application) test please!

    And is it possible to play an mp3 sound with an application at the beginning of the unit?

    Thank you in advance!

    It is perhaps the issue:

    «I put the mp3 file in the same directory files .java and .jdp.»

    The MP3 resource must also be added to the project.

  • Problems with Manager.createPlayer)

    Hello

    I'm new in the world of development of BB... I'm doing a simple application that retrieves a file from a URL .wav and it plays, but the process is stuck on Manager.createPlayer (URL).

    I ran the application using the debugger and when it comes to this line he says 'source not found', here's a snippet of what I'm trying to do:

    public class MyPlayer implements PlayerListener, passable
    {

    Player;

    (I call this my main application thread and start it)

    {} public void start()
    Thread t = new Thread (this);
    t.Start ();
    }

    void run() {}
    try {}
                       
    String url = "http://java.sun.com/products/java-media/mma/media/test-wav.wav";

    Create an instance of player
                 Player = Manager.createPlayer (url); (it gets stuck in this line and the IDE shows a source not found)
    player.addPlayerListener (this);

    make the player
    Player.Realize ();
    Player.prefetch ();
    Player.Start ();
    }
    {} catch (Throwable t)
    reset (); This is a method of myself
    }
    }

    }

    The funny thing is that I tried the same code with a MIDlet and it works well in Nokia and Sony Ericsson simulators, but Blackberry is locked. I'm missing something here?

    I use Eclipse IDE, BlackBerry JDE component Pack Version: 4.5.0.16 and the Simulator Curve BlackBerry 8300 that come with the JDE.

    I also tried the application in a BlackBerry Pearl Simulator, with the same results

    Any advice will be highly appreciated = (...)

    I found the solution, the problem was that my emulator had no access to the internet, when he tried to connect to the URL and get the .wav file it so never found the source.

    I downloaded Blackberry email and MDS services Simulator package, which allows the internet connection for the simulators, and it worked!

    I could connect to the URL and play the .wav

  • What is c? It is in Device Manager no plug & play drivers Code 24 problem

    What is c? It is in Device Manager no plug & play drivers. It has an Exclaimation Point on the list. Problem Code 24. Does not work properly. No availible solutions. I have problems with slow PC & can get not Canon MP 160 to print photos. Had a Runndll/cnmss on Start up.

    This is almost certainly an outdated driver for antivirus MSE - you have probably a new set already installed.

    just right click on the driver and choose uninstall.

  • No Windows sound "Failed to Play Test Tone" error during the speaker test

    I have a desktop computer with a processor Intel Core 2 Duo CPU 32 - bit Windows 7 Home Premium.  It has run successfully for 2 years without any problem.  Sometimes the last month the noise stopped working.  When I try to configure the speakers I get the error message "Failed to play Test Tone".  It was originally plugged into the sound of the motherboard, so I purchased and installed a sound card.  After you have installed all the drivers, the sound still doesn't work, and I get the same error message.   I went through the tutorial 'No Sound in Windows' and run the audio troubleshooter, it does not find a problem.  I installed a new instance of Windows 7 on a partition on the same computer.  This instance of Windows sound plays, so I know the sound card works.  I think that a recent Windows Update may have caused the problem, but I can't understand that one.  Does anyone have a suggestion as to what I should try next?

    Thank you

    I ended up reinstalling Windows.  After that I did the sound came back.  I look very carefully at updates and ensuring that I have a return upwards before allowing Windows updates.  It was a major pain but at least my husband can now watch his videos with sound.

    Carol

  • ClassCastException on Manager.createPlayer problem with DataSource

    I run the code BufferedPlayback (JDE 4.7.0) example loading a local file (LimitedRateStreamingSource to the source of data):

    final LimitedRateStreamingSource source = new LimitedRateStreamingSource("file:///store/home/user/test/test.wav");
    source.setContentType("audio/x-wav");
    final Player player = Manager.createPlayer(source);
    

    but when I create the player a ClassCastException is thrown.
    Search with google I found this method performs a cast to CommonDataSource, and this leads to the exception (http://discussion.forum.nokia.com/forum/showthread.php?t=113902).

    I can't figure out how to solve this problem... someone has any advice?

    LimitedRateStreamingSource in this example expects a HTTP URL.  When you use it with a file:/// URL a FileConnection is returned by the Connector.open call, which triggers a ClassCastException.

    You will need to modify the example to use a FileConnection instead of a ContentConnection.

  • Streaming media files by using Manager.createPlayer)

    Hey guys,.

    quick question...

    I have my application to connect to the internet via '; interface = wifi. "

    and I stream media help

    Player p = Manager.createPlayer("http://somelocation/blah.mp3");
    p.start();
    

    Whenever I run it, it throws an exception: "Bad Tunnel. If I add '; interface = wifi"at the end of the url, it is said that it is a bad URL.

    Is there anyway to force the player to broadcast using the wi - fi connection?

    For some reason when I use the example of buffering in playback when the player is told to stop, it stops playback but it continues to download the rest of the file when I call destroy() and even when I force stop & close each involved single stream. This is a problem since the other players on the same screen does not start streaming up to what the first stream is completely downloaded.

    With the help of; = wifi interface should work in a URL used in the createPlayer method.  What model of Smartphone BlackBerry and the BlackBerry terminal software version you test on?  You can find this under Options, all on the BlackBerry Smartphone.  What is the BlackBerry handheld is connected to a Wi - Fi network at the time?  Note that the BlackBerry Simulator support no simulation of a Wi - Fi connection.

  • RAM Preview does not play from the beginning

    Anyone run into this.  When I RAM Preview, it does not start video playback up to about 1 second at first.  When loops overview it plays from the beginning, problem is only with the first reading.  Annoying to say the least.

    There is a bug in Mac OS x v10.10 (Yosemite):

    After Effects Mac OSX v10.10 (Yosemite)

  • music 9 plays the song wrong iOS app

    I have an iPhone 6 s, version 64 GB running iOS 9.3.1.

    I found that very often when I play music in the music app, I'll try to select a song and instead to play this song, it will play the song under him, or the song two or three under where I selected. This isn't a question "you must have shuffle." It seems that other people have had this problem since iOS 7. Music force the application to quit and restart the phone seems to solve the problem for a while until he back randomly.

    There is nothing wrong with my touch screen, it works perfectly fine. The songs are there, I can play if I choose a song, two or three preceding that I want to play or if I ask Siri to play the song. At first, I thought maybe my phone somehow lose data from the music and the song to jump because he couldn't play, but this is obviously not the issue. If people had problems of this kind in the iOS 7 I would have thought by iOS 9.3.1 it was something that's been fixed now.

    Anyone else have any ideas? It's really annoying.

    After some research, I found that somehow the shuffle function has something to do with this problem because it disappears if I turn off shuffle. However, while shuffle is on and sat for a while, he will refuse to play the song as I type, rather play another song usually songs, that I hit the underside of the. If I disable the shuffle, the problem goes away for a while, even though I turn on shuffle immediately. But eventually the phone will not play the song that I select. It's the strangest thing I've seen my phone so far.

  • Flash Player playing multiple tones at the same time... even when the browser is closed

    I recently updated my Flash drive to 11.3 (latest version). When I go to a site that uses Flash (YouTube, for example), I'll start the video and then 10 seconds later, I get multiple tones at the same time. They all look like advertising, or TV stations. Even when I close my browser, the sound continues. When I opened my sound mixer, it is a "program" listed in "winrscmde", who plays both audio channels. When I go to the Task Manager, "winrscmde" presents itself as a svchost.exe * 32. When I stop this service the sound stops. It will resume again when I access a flash site. When I uninstall Flash Player 11.3, it stops.

    I am running Windows 7-64 bit with latest updates. THAT IS TO SAY 9.0.8112.16421

    Any help would be appreciated.

    Well, I think I solved the problem.

    I found this topic:

    http://www.bleepingcomputer.com/forums/topic442928.html

    On the second post down, the poster recommended download killer TDS winrscmde.exe is disquised as svchhost.exe in the \windows\system32 folder (you click on 'Properties', then the 'Détails' tab and check the original file name... If it is false, it will say winrscmde.exe under the original name).

    I also ran the program aswMBR as well as FixTDSS (http://www.symantec.com/content/en/us/global/removal_tool/threat_writeups/FixTDSS.exe).

    That seems to fix the problem. Just reinstalled Flash and do not get the same questions. The svchost.exe in the \windows\system32 folder is legitimate!

    Hope this helps someone else with the same problem.

  • So why make a movie in movie maker, the only way to get the song to play with the photos in sequence is in play from the beginning?

    I am trying to edit photos to last for some parts of the songs (fade in and out where I want to that they), but the only way to see what the photos of 'falling' in the song by playing the song from the beginning. Every time. It won't let me go to a certain section of the timeline and play both the photo and the song at that time here (it takes me to the photo, but he began to play the song in some random place)?

    Thank you very much!! =)

    Hello

    Once you have added music, go to the Options tab. Now click on Split (in fact the split music) you should see the music bar along the top of the film split.

     

    Audio setting in Windows Movie Maker: frequently asked questions (valid also for Windows XP)

    http://Windows.Microsoft.com/en-us/Windows-Vista/adjusting-audio-in-Windows-Movie-Maker-frequently-asked-questions

    See also: http://windows.microsoft.com/en-US/windows-xp/help/movie-maker/faq

  • Music / sound plays from the beginning

    I'm starting a new Flash animation (I've not used the Flash in a few months, but it says it is updated), and for some reason, I've added music, will only play if I start from the beginning of the timeline. If I start from anywhere in the middle of the timeline, after the departure, the sound is not reading at all. What is going on? Can it be fixed?

    What you describe would be the case if you have defined a test of properties. Change that to the stream.

  • How to make sure the Animation still plays from the beginning

    Hi guys,.

    I'm working on a project to facilitate dashboard which consists of 3 animations. I have a problem when I navigate between each symbol, without allowing that each completed in full animation. Rather than play as they should, from the beginning of each animation, animation simply continues to play from the position as was the timeline when I navigated away to another symbol.


    Is it possible that I can reset the symbol in its original position, when I trigger another animation to make sure that each animation always time from the beginning?

    Has anyone else had a similar problem? Any help will be much appreciated as always.

    Thank you very much


    Ross

    All included now - it works, and you do not have the script fixed correctly.

    The only thing I noticed is the placement of you reading action, see capture.

    I didn't move a bit. And by that I mean set it so that the beginning of the fall of play icon AFTER the reading, the alignment exactly where the label of separation begins - see figure.

    In your case it was not aligned correctly. I also changed the read option play to play to 0:00.

    HTH

    Darrell

  • Audio attached to the button "submit" plays at the beginning of the slide

    I created a text box with a "submit" button. When someone types in their response and clicks submit, text comments will appear and an audio excerpt explains the answer. I have attached the audio, the button submit, but when I go through the project that it plays as soon as the slide appears, not after the answer to the question. He does not appear in the timeline panel, but played when I go to the Audio tab of the submit button. As an aside, the audio on the success and failure of the feedback will be the same. Does make a difference? Should I attach audio to the legends of f/b?

    Any ideas on how to solve this problem?

    PS - the Captiv8er - you were so help kind it has everyone (me)! THX!

    Well, how about that? I am answering my own question...!

    With more tests, I found that if I join the audio for the legends of success or failure, she plays after the answer to the question. The audio was playing when the slide appeared first of all because I loose to the Submit button, which is visible from the beginning of the slide.

    Thank you, me! (Maybe I'm starting to find it?...)

  • Need a list of what I can stop using the Task Manager to help play games that are hanging up or jump or stopping programs.

    I know how to stop most of the programs running in the back ground by using the Task Manager and the process tab.  But, I click "Show processes from all users" list is double what it was.  I need a list of what I can finish process without going through the computer off and restart or with on dreaded blue screen.  So I ask if anyone has a list of processes that are sure to stop?  Thanks in advance, Frankster195

    Hi Frankster 195,

    Welcome to Vista forums.

    You can try to perform a clean boot. Check the mentioned below of items.

    How to perform a clean boot procedure to determine if background programs are interfering with a game or a program that you currently use

    http://support.Microsoft.com/kb/331796

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/default.aspx/KB/929135

    Hope this information is useful.

    Thanks and regards.

    Thahaseena M
    Microsoft Answers Support Engineer.
    Visit our Microsoft answers feedback Forum and let us know what you think.

Maybe you are looking for

  • I can't text people with iphones after swinging back on android

    Hi, half the people I text with have iphones and I can't receive text messages from phone calls I went from 5 c to Samsung Note5 iPhone I was getting texts from users of the iPhone on my note3 without any problem. IPhone News: it has a capacity of 12

  • Dysfunction of graphics on a Satellite 5200 801

    I have a Toshiba Satellite 5200-801 (nr.PS 520-31P1D-PT) with the following problem: After pressing the button operation, the screen shows vertical stripes, alternately, with large rectangle B & W points. After Windows XP spit and the only thing I ca

  • Tecra S10 does not hibernate on XP Pro

    Hello Tecra S10-10th with factory v Bios 1.60 (localozed in Polish). All new opened its doors today. Everything works except that the machine hangs during the return form XP hibernation mode.Recovery DVDs contains XP Operarting system preinstalled Se

  • System information: any way to enlarge the size of the text?

    The Information System page is very useful.  But the fonts on my system are tiny.  About 2mm of height for some letters.  So I was wondering if there is a way to make the text a little bigger?  I have already selected the Extra Large screen fonts, ap

  • Displays only half a page.

    I have a HP Deskjet 2540 printer all in one and I have constant problems with it! First of all if I send more than one page to the printer, it prints a page and half of the other. I then return the last page of the printer. I had this problem from th