Reading audio file included in the project

Right now I am able to play audio files by extracting a path of the file location.

Ex: file:///SDCard/BlackBerry/music/file.wav

I suspect that this will help.

http://supportforums.BlackBerry.com/T5/Java-development/add-plain-text-or-binary-files-to-an-Applica...

Be sure to add the file to your project.

Tags: BlackBerry Developers

Similar Questions

  • Want the audio file, click on the box to play when you click

    Hi all

    I would like to have a click box that plays a short audio file when you click it, much the way you can have a view of the legend and a playing audio file with a bearing. It seems that there is no way to get the 'success on click' action to be 'read the audio file '. I can associate an audio file with the box click on the Audio tab, but this makes the audio file play automatically when the click box, not display when clicked.

    If someone was able to get an audio file to play when the user clicks on a click box, as I describe it, without connection to another slide and without the help of a button? I don't want to use a button because the real object that is clicked is a box of nail on something else. The highlight box means that there is more information about the highlighted item.

    In addition, I don't want to create a branch to another slide, because they are really short texts of audio presentation bit, and I have three of them. I prefer to have interactivity on a slide, rather that force the user to navigate around.

    If anyone did what I describe and has ideas, I welcome them. At this point, I think a bearing with legend and play on the mouse on an audio file can be the best thing, except if the user moves the mouse out of the hotspot, the sound stops. Maybe it's not bad anyway, but thought I'd check here everything first before resorting to a reversal.

    Thank you very much!
    Lisa

    Hi Rick!

    Thanks a lot for your answer. Hmm... I think in my situation, workaround to reread the previous slide to reset the box click doesn't work. Before arriving at these interactive click boxes, the slide has other text and audio playback. Start the slide would re-read everything until the blade stops, then display the interactive elements. However, I think that something like that might work for a project where the interactive stuff "starts" immediately on the slide. It's simply not how mine is set up at this stage. I think that the legend of attached with audio reversal will probably be my best option right now.

    Thanks again for your response!
    Lisa

  • How to play audio files, one after the other?

    Hi, I try to create an application that tries to read audio files a few one after the other. I've created a loop for playing audio files. But only the first track is played and the second song is playing only about 5 seconds while the rest do not get played at all and the two files that have played, pieces overlap, which is not supposed to be. Can you guys help me? I need urgent assistance that I need to finish it tonight.

    Here are my codes I created for the application:

    package mypackage;
    
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    import java.lang.Class;
    import javax.microedition.rms.RecordStore;
    import java.io.InputStream;
    import java.io.ByteArrayInputStream;
    import net.rim.device.api.media.protocol.ByteArrayInputStreamDataSource;
    import net.rim.device.api.system.*;
    import net.rim.device.api.ui.*;
    import net.rim.device.api.ui.component.*;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.extension.container.*;
    import net.rim.device.api.ui.UiApplication;
    import java.io.IOException;
    
    public class PlayMedia extends UiApplication{
        /**
         * Entry point for application
         * @param args Command line arguments (not used)
         */
        public static void main(String[] args){
    
            PlayMedia theApp = new PlayMedia();
            theApp.enterEventDispatcher();
        }
    
        public PlayMedia()
        {
    
            pushScreen(new PlayMediaScreen());
    
        }
        /**
         * A class extending the MainScreen class, which provides default standard
         * behavior for BlackBerry GUI applications.
         */
        final class PlayMediaScreen extends MainScreen
        {
            /**
             * Creates a new PlayMediaScreen object
             */
            public Player p = null;
            PlayMediaScreen()
            {
                String test3 = "Test(2seconds).mp3";
                String test5 = "Test(2seconds)2.mp3";
                //String test6 = "Test(2seconds)3.mp3";
                String test4 = "Test(2seconds)4.mp3";
                String test1 = "blind_willie.mp3";
                String test2 = "blind_willie.mp3";
                String mp3 = null;
    
                for(int i=0;i<5;i++){
                    if(i == 0){
                        mp3 = test1;
                    }
                    else if(i == 1){
                        mp3 = test2;
                    }
                    else if(i == 2){
                        mp3 = test3;
                    }
                    else if(i == 3){
                        mp3 = test4;
                    }
                    else if(i == 4){
                        mp3 = test5;
                    }
                    //testing
                    System.out.println("Song is "+ mp3 + "???????????????????????????????????????");
    
                    play(mp3);
    
                    System.out.println("Song is "+ mp3 + "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
                }
            }
    
            private void play(String mp3){
    
            InputStream stream = (InputStream)this.getClass().getResourceAsStream("/" + mp3);
    
                try {
                    //p = Manager.createPlayer(source);
                    p = Manager.createPlayer(stream, "audio/mpeg");
                    p.realize();
                    p.prefetch();
    
                    //testing
                    System.out.println("Creating Players!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
                    System.out.println("The mp3 is " + mp3 + "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
    
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
    
                    //testing
                    System.out.println("IO Exeception!!!!!!!!!!!!!!!!1 " + e);
    
                    //testing
                    System.out.println(p);
    
                } catch (MediaException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
    
                //testing
                System.out.println("Media Exeception!!!!!!!!!!!!!!!!1" + e);
    
                //testing
                System.out.println(p);
                }
                /*
                 * Best practice is to invoke realize(), then prefetch(), then start().
                 * Following this sequence reduces delays in starting media playback.
                 *
                 * Invoking start() as shown below will cause start() to invoke  prefetch(0),
                 * which invokes realize() before media playback is started.
                 */
                try {
                    p.start();
                } catch (MediaException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
    
                    //testing
                    System.out.println("Media Exeception for starting!!!!!!!!!!!!!!!!1" + e);
    
                    //testing
                    System.out.println(p);
                }
                /*
                try {
                    p.stop();
                } catch (MediaException e) {
                // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                p.deallocate();
                p.close();
                */
    
            }
        }
    }
    

    Please help me! Thanks in advance!

    What you will do, is add the PlayerListener and / if you have in your loop code would go in the treatment of the END_OF_MEDIA event. Once that noise has stopped you will start the next sound and add the listener of player.

    //Declarations
    PlayerListener pListen;
    String mp3 = "";
    
    ..........
    ..........
    
    pListen = new PlayerListener(){
       public void playerUpdate(Player player, String event, Object eventData) {
          if (event.equals(PlayerListener.END_OF_MEDIA)) {
             if( mp3.equals(test1) ) mp3 = test;
             else if( mp3.equals(test2) ) mp3 = test3;
             else if( mp3.equals(test3) ) mp3 = test4;
             .........
    
             InputStream stream = (InputStream)this.getClass().getResourceAsStream("/" + mp3);
             p = Manager.createPlayer(stream, "audio/mpeg");
             p.realize();
             p.prefetch();
             p.addPlayerListener(pListen);
             p.start();
          }
       }
    }
    
    InputStream stream = (InputStream)this.getClass().getResourceAsStream("/" + mp3);
    p = Manager.createPlayer(stream, "audio/mpeg");
    p.realize();
    p.prefetch();
    p.addPlayerListener(pListen);
    p.start();
    

    So, add the try-catch blocks.

  • BACKUP QUESTION: Why is it when I backup the Lightroom Catalog (Edit |) Settings of catalog...) only the *.lrcat file included in the ZIP file... While the *., lrdata file, the preview files, ARE NOT INCLUDED?  When I restore the file *.lrcat from a backu

    BACKUP QUESTION: why is it that when I backup the Lightroom Catalog (Edit |) Settings of catalog...) only the *.lrcat file included in the ZIP file... While the *., lrdata file, the preview files, ARE NOT INCLUDED?  When I restore the *.lrcat file from a backup, WHERE ARE THE PREVIEW FILES that should be included in the ZIP to the top.  If *.lrdata (Preview file) are so important, why are not included in the zip?  [email protected]

    CraigLevine wrote:

    OK, so that's my scenario:

    • QUESTION: WHEN I USE THE [Sub-master] .lrcat, on the new computer, don't need to inculde also files .lrdata [Sub-master] on this external drive?
    • If .lrdata [Sub-master] is regenerated automatically, where he gets all the work (from the preview files) that I did, when I was working, using the .lrdata [Sub-master] when he was on the local disk.

    Thanks again for staying with me on this.  I don't know that your answer will solve my confusion. -Craig

    [email protected]

    Questions 1)

    Not because the LRDATA file is fair previews, what LR displays on your screen for a faster loading of the image and will be recreated. The previews only stored in the folder LRDATA is the basic overview created at time of importation for the display of thumbnails and previews of 1:1 for images that you have actually looked in the Loupe View or I guess that appears in the develop module.

    He get all the data to create the image themselves file extracts.

    If you have several files on your system that have pictures in them and you select one of them that you have not looked at in a while, you will notice LR creation of previews for these images, there will be 3 white dots in the upper right corner of the thumbnail. It's LR creation of previews for the thumbnail view. If you scroll quickly in the grid view, you'll notice a few thumbnails of images are gray, until you stop scrolling, then the upper left tile will come in clear view and the white dots will appear on the other images. It's LR creating previews for those of other images. Once LR created the preview of thumbnails that are on your screen, white spot will disappear. If you scroll down again, you will see more white dots

    If you switch to another folder that LR begins again create preview images in this folder. The total number of previews created and stored based on caching of the preview you have in the catalog settings dialog in the management of the files tab.

    If not, you need not the LR Previews.lrdata folder. Whenever LR is not very good this folder with a catalog he recreates it to store previews in.

  • Can I disable right click on an audio file to prevent the download of the file?

    Can I disable right click on an audio file to prevent the download of the file?

    I created a player driven Dashboard using the audio player by default - however I noticed now that I can right click and download the audio file - can I disable this?
    Or do I have to create my own buttons play/stop to avoid this problem?

    EA_player.jpg

    Hello

    Yes, you can disable the context menu on an audio clip - but also not, because you can't really tell someone who knows how to use the development tools of the browser to find and download the audio source file.

    However, to disable the right-click menu on your audio, add this code to your compositionReady stage manager:

    SYM.$("your_audio_element").bind ('contextmenu', Function () {return false; ;})})  of course, replace the name of the element with the name of your audio

    HTH,

    Joe

  • How to read a file of all the text in a pl/sql variable?

    Hi, I need to read an entire text file - which actually contains an e-mail message from a system of content management - in a variable in a pl/sql package, in order to insert the database information and then send the email. I want to read the whole of a sudden text file, no not one line at a time. Shoud I use Utl_File.Get_Raw or is there a more appropriate to do this?

    How to read a file of all the text in a pl/sql variable?

     ...
    your_clob_variable := dbms_xslprocessor.read2clob('YOUR_DIRECTORY','YOUR_FILE');
    ....
    
  • Cannot read txt file correctly on the cRIO RT after deployment system

    As shown in attachment VI works fine on my system cRIO9073 during execution of the Project Explorer and press the arrow. But unfortunately it no longer works when it is deployed (having a build). This VI is part of a larger project, but I was able to trace the issue to this VI, where something goes wrong with the reading of the text file. I now use the case of fake (not shown), where I have temporary added the txt file content in a string constant. Of course, it's a good solution, but not flexible.

    Anyone have an idea what's not here?

    I use NEITHER-RIO 3.1.0 - January 2009 version as the version of the software on the cRIO system.

    Hello

    I don't know that you still have this issue, but I think that you cannot use this property (axis type) node in your cRIO. If please remove it and try again to see what would be the influence.

    I'll hear it on your part.

    Kind regards

    Hossein

  • Cannot modify READ ONLY file attributes using the administrator account

    I tried the windows Explorer and a custom program called Directory Opus. I tried to create several administrator accounts, but not luck.

    I can't work with this existing problem.

    I need a solution.

    I have exactly the same problem.  Following the steps above did not work, folders/subfolders unchangeable rest.  I am the owner of the folder and subfolders.  I don't know yet how they became Read-Only to start.  Read-only on the individual files setting works correctly.  Changing the settings of file does not work.

    IMPORTANT EDIT:

    According to a message from the Microsoft Knowledge Base:
    You cannot view or change the read-only or system attributes
    To summarize, Windows does not include system or read-only folders settings (he was aware of these properties on the FILES however).  Individual applications that you use cannot ignore the State of read-only on a folder and can give an error.  In my situation, an application was trying to create a new file in a folder that has been marked read-only and honored the RO parameter and refuses to try to create the new file.

    To actually change these attributes, properties menu will not work.  The KB source:

    • If you click apply changes to this folder only , the read-only attribute is changed for all files in the folder. However, the read-only attribute is not changed for the folder, its subfolders or files in its subfolders. If you click apply changes to this folder, subfolders and files , the read-only attribute is changed for all files in the folder and all files in the subfolders. However, the read-only attribute is not changed for the folder or its subfolders.

    To change these properties, the user must start a Terminal command line and execute the changes by hand, for example, this command:

    • attrib - r + s c:\test

    .. What will remove the READ ONLY parameter and apply the SYSTEM setting in the folder.  Once more, change the properties of files (including files in subfolders) works as expected with the right click - Properties-> Security menu.

    The basic source of knowledge:

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

    Bad support, Ms.

  • Does not read audio file

    Hello. What should I do to import my WAV to projects?

    Disk space is waaay OK. I don't understand this sentence.

    E2SWqKv.png

    So I try to import a convert a MP3 file, but no help. Then I try to import each different random MP3 in the project. MP3 is in project, I can import and see them, but there is no sound on the whole of the project! I play through that audio will not play.  What's wrong? My music is available to hear when I push "Numpad 0" key. Strange, I do not understand. How to fix?

    Troublemaker says:

    Can you tell me what I can not just NORMALLY press the button "PLAY" and hear a song?

    ....

    Why play sound does not work the same as Adobe Premiere?

    Because they are completely different kinds of programs made for completely different tasks. The way NORMAL for a preview in AE is to press the Num 0 (or Num. If you just want to hear the sound without waiting for a RAM Preview). It is the normal way to EI.

    Rick is right; you really, really need to go through some good, basic resources to let you know how to use After Effects. You will get more frustrated as you go along, if you avoid the basics like that.

    I highly recommend this resource: http://adobe.ly/AE_basics

  • Need to publish only the files selected in the project of RH6

    Hello

    Let's say I have 50 .htm files already in a project of RH6. I want to only publish 20 of these files. Manually, I created a table of contents and related in these 20 files. However, I noticed that when I did a search in the final help file - results of research links to other 30 files. I want only that everything which is related to the table of contents to publish.

    Thank you
    FMnRH

    All topics are included in any output, regardless of whether or not they are in the table of contents. To exclude topics, you need to put a conditional tag on them, and when you build, create an expression of generation not some label that you applied.

  • Read xls file and display the data in the table.

    Hello

    Try to read the data from an xls or csv file and fill the same data in the table. If I need to use the table to store the data from the file and display, hoping that someone could help.

    Thank you

    Hari

    Hi hari,.

    One thing that is very important when you use the Excel activeX interface (in case you need it) is good termination of worksheet/workbook/lettering handles.

    You need these handles to specify what cell in which file you are trying to access.

    If you are unable to throw each handle you have, then you will be left with ghost Excel process in your task manager, devours your system's memory.

    Thus, when debugging of your application, open the Task Manager and the watch as Excel treats created/destroyed and make sure that you end up with zero Excel process running when your application is closed.

    Also consider the case of fault for your program. Check that your exit routes did not omit any termination of handle.

  • FileToArray or readline to read a file and displays the information in a textbox control

    CVI, I am a beginner and I have a few basic questions.
    I am currently using CVI 2009th

    I want to open a file and transform it into another format. The most important information to be included on the GUI.

    The text display, I use the text box.

    With readline, everything has worked, but for my rows of data is rather impractical.

    That's why I tried the same thing with FileToArray. But the table does not appear in the text box.

    I don't know exactly how works the text box. Is - that the textbox is a page break after a certain number of characters? Or I can write a text in succession away?

    Here are a few lines of my code.

    FileToArray

    FileToArray (road access, & fcsLine, VAL_CHAR, fcsfile_numberofelements, 1, VAL_GROUPS_TOGETHER, VAL_GROUPS_AS_ROWS, VAL_ASCII);

    What is the proper way to display text with filetoarray?

    SetCtrlVal (tabPanelINFO, TABINFO_FCS_VERSION, fcsLine);

    InsertTextBoxLine (tabPanelFCS, TABFCS_FCSBOX,-1, fcsLine);

    ReadLine

    While ((fcsfile_open, fcsLine, fcsfile_numberofelements) ReadLine > = 0)
    {

    InsertTextBoxLine (tabPanelFCS, TABFCS_FCSBOX,-1, fcsLine);

    }

    OK I found documentation on the format of your data, and it seems at the first glance not so difficult to decode.

    A few answers to your questions:

    1. opening a file in ASCII mode allows the system to recognize and welcome the correct new line character (the one that allows to ReadLine to interrupt playback) sequence. As you treat binary data may be ASCII option is not the best, you can use

    2. using a data structure or by analysing the single lines in significant variables is somewhat equivalent: in my opinion, the structure is more immediate, she may not need any extra data setting to use correct variables populated by vales (depends on data format and packaging data: little - endian or big-endian and so on)

    3. as much as I've seen in the part of the file that you have posted, the hexadecimal bytes you observe are not in the file: they are only a means of your Viewer uses to represent unprintable binary data

  • I want to burn an audio file which, in the wire, exceeds the amount on a cd

    I have records on a record ic and want to burn it on cd, but because that the records are more that what will hold a cd.
    I don't have a problem with having the recordings on cd 2 but don't know how.
    If I can do it on 1 cd, that would be great, but don't know how to do no more.

    Help, please
    Shelley

    try to split the original audio file into smaller parts, try something like this: http://download.cnet.com/Slice-Audio-File-Splitter/3000-2169_4-11107011.html

    but there are a lot of free software out there that does the same job.

    Once that his division into smaller parts, it should be OK.

    Consider buying a DVD burner, they are only about US $30 and a DVD can hold almost 5 times that of a CD.

  • Cannot change attributes read-only files, by updating the drivers help Driver Whiz from HP.

    Original title: change file attributes

    I'm updating some drivers help Driver Whiz from HP.  The new drivers download but will not be installed.  Apparently, I need to remove the read-only file attributes, but no matter what I do it continues to change the next time I have access to the file to read-only.  Any ideas?

    Hi keuller,

    You can read the following article and check if it helps:

    You cannot view or change the read-only or the attributes of system files in Windows Server 2003, Windows XP, Windows Vista or Windows 7

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

    Hope this information is useful.

  • How can I sort my media file name of the project "icon view"?

    Hi all. I am trying to sort my media in the 'Project' Panel while displayed his point of view 'icon' file name and it's not working (I am running first Pro CC on a Windows 7 machine).

    I can sort very well in the project "List View" of the Group (by clicking on one of the headers, which is on the file header), but once I have switch back to "Display the icon" they lose their sort order (they seem to come to some sort of 'disorder' of the thing...)

    I'm sure that my files are already sorted by file name when I click on the import button and access to view of Windows Explorer, but it does not help either.

    Any suggestions? Thanks to you all.

Maybe you are looking for