How to decrease the size of the audio file

I am able to record successfully using the microphone of the blackberry through code. However, files that are deployed are .amr files.after a record of say 1 min a 132 k file is made.which is pretty huge J2ME standards

Dere would amount another type of encryption as a .amr making files lighter. What can I do dat if a large no. small files are made instead of one heavy file.

private static final long mtime = 100000;//records for 1min
RecordControl rc;
byte[] data;
public void run()
{
    // TODO Auto-generated method stub

try

    {  Player p = Manager.createPlayer("capture://audio?encoding=amr"); // Player p set to capture audio here
        p.realize();
        rc = (RecordControl)p.getControl("RecordControl");
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        rc.setRecordStream(os);
       /**FileConnection fc = (FileConnection)Connector.open("file:///store/home/user/RecordedFiles/audio1.amr");

        //if(!fc.exists())
        {
            fc.create();
        }

        DataOutputStream  ot= fc.openDataOutputStream();**/

        //rc.setRecordStream(ot);

          rc.startRecord();//starts the recording
          p.start();
          Thread.sleep(MikeApp.mtime);
          rc.commit();
          p.close();
          data = os.toByteArray();
          saveRecordedFile(data);

        if (p != null)
        {
            p.stop();
            p.close();
            p = null;
        }
    }
    catch (IOException e)
    {
        e.printStackTrace();
    }
    catch (MediaException e)
    {
        e.printStackTrace();
    }
    catch (InterruptedException e)
    {
        e. printStackTrace();
    }
    return;

}
public static boolean saveRecordedFile(byte[] data)
{
    try {
        String filePath1 = System.getProperty("fileconn.dir.music");
        String fileName = "Call Recorder(";
        boolean existed = true;

        for (int i = 0; i < Integer.MAX_VALUE; i++)
        {
            try {
                FileConnection fc = (FileConnection) Connector.open(filePath1 + fileName + i + ").amr");

                if (!fc.exists())
                {
                    existed = false;
                }
                fc.close();
                }

            catch (IOException e)
            {
               // Dialog.alert("unable to save");
                return existed;
            }
            if (!existed)
            {
                fileName += i + ").amr";
                filePath1 += fileName;
                break;
            }
        }
        System.out.println(filePath1);
        System.out.println("");
        FileConnection fconn = (FileConnection) javax.microedition.io.Connector .open(filePath1, javax.microedition.io.Connector.READ_WRITE);
        if (fconn.exists())
            fconn.delete();
            fconn.create();

        OutputStream outputStream = fconn.openOutputStream();
        outputStream.write(data);
        outputStream.close();
        fconn.close();
        return true;
    }
    catch (Exception e)
    {
        e.printStackTrace();
    }

I am currently capable of recording using the microphone and a .amr file is created whose recording time is as much is specified in the sleep.
However what I want, is that a new file is created each time after recording for a certain period of time.
Say record1.amr records for 1min.and as soon as the min is on a new file is created.
in this case up until the time uninstall us the application.
could I get a preview

Tags: BlackBerry Developers

Similar Questions

  • Prime Minister 9. I made a mistake when I did drag an audio file in the line of the image. How to remove the audio file. I tried ctrl z and shift delete nothing done.

    Using Adobe Elements 9 first, I made a mistake when I did drag an audio file in the line of the image.

    How can I delete this audio file? I tried ctrl z and shift delete. software has the ' delete the scene and all of the properties in gray. Just "delete scene only" it and it does nothing to remove the audio file.  I had to drag the line from the soundtrack.

    Who can help me?

    LinFos04

    What you wrote, it seems that you are in the scene of Premiere Elements 9.0/9.0.1 workspace.

    Please see screenshot showing you how to remove the audio immediately after you dragged in the film that had been marked "Drag the next clip here"

    Moving forward consider working in the workspace of timeline that gives you a better view of what is happening and therefore gives you more control over the flow of work. Please click chronology to watch how this audio present in the workspace of chronology after what you did in the space of the stage line.

    Please let us know if it worked to get rid of the audio unwanted in the Premiere Elements 9.0/9.0.1 workspace sceneline.

    For any question or need more information on the above, please ask.

    Thank you.

    RTA

  • How to associate the audio file with progress bar

    Hi all

    I have a case in which I need to associate an audio file with a progress bar. What I want to do is to able to read an audio file that will say "Started process..." "Continuous on" process ends and it is and must be synchronized with the progress bar. Is it possible to do so.

    Please let me know

    Thank you

    Ankit G

    Are you referring to a LabVIEW horizontal/vertical progress bar that basically an integer U8 constantly wrote in it? Is it in a loop as it fills?

    If so, there is a full range that allows you to listen to the signals. As you write the number of your progress at the helm, you can keep control of what the number is (structure of the event or case), and when it hits special values, you play special sounds. Here's a screenshot of this palette.

  • How to insert the audio file (drive) to the web page of Muse?

    I am designing a web page in Adobe Muse CC and how do I insert music to the web page file, so I can be played? GisliG

    Hello

    Please visit the following link Re: how to add audio in Muse (not in background)?

    Kind regards

    Aish

  • How to decrease the size of the screen in Safari?

    New using OS el Capitan.  Using Safari and I must have hit something because now "Safari" to fill my entire screen.

    I don't know how to decrease this size.  Nothing else is available on my desk. I would like suggestions.

    Thank you.  Ed Woz.

    Press

    Command, control and the button of the letter 'f', all at the same time.

    It activates / deactivates the display full screen back.

  • How to decrease the font size in safari?

    The size of the police looking for google in safari is too large, there is not space to watch between the lines, how to decrease the size of the font? the zoom in and out does not work, the font remains the same size and the letters overlap. HELP PLEASE

    Without using a style sheet, you can't.

  • How to decrease the size of the photo in the background

    I'm new to computers. I am trying to create a photo background slide show that I have stored in a folder on my computer.

    However, the images seem to be too big for the screen, it seems that if it is 150%. I do not know how to decrease the size.

    Help!

    Hello

    1. what operating system is installed on your computer?
    2. what application you use for the slide show?

    If the wallpaper looks too big on your screen, I suggest you follow these steps and check if they help (if you are using Windows 7 or Vista).

    a. right click on an area empty office.
    b. in the menu that appears, click Customize.
    c. in the window that appears, at the bottom, click on wallpaper (wallpaper).
    d. down, you will see the image of the menu position drop-down, click it.
    e. Select, Center or fill, or made or stretch or tile, I think that Center is the one you want.
    f. click on save changes.

    Your photo must not be larger than the screen

  • How to decrease the size of the PDF file without reducing the quality and links?

    How to decrease the size of the PDF file without reducing the quality and links?

    Michael and Phil,

    Your ability to reduce the file without diminishing its quality depends on the quality required for their intended use. If these are intended for viewing on screen, then high resolution pictures can be re sampled or changing the resolution without real change is the quality, as long as the user can say. Number of files use subsets of fonts or the incorporations of fonts. Sometimes you can remove subsets of fonts or embedding the fonts if the font will be on the user's system. Subsets of fonts can save space, but if the pdf is a result of several different sources, desincorporation policies and incorporating a copy of the policy can save space.

    Honestly, the size of 2 MB file is not the problem it once was. However, maybe the pdf not by e-mail at all. There are players on a server as well as a link sent to each user.

  • How to decrease the memory Pool.

    Hello

    I'm going to install Oracle database 10g Release 2 on windows xp
    and I want to decrease the pool of memory for the database
    to load very quickly do not take the amount of system memory.
    because I installed so it is very very slow at the time of departure
    so I expected 5 min to boot my system and service was very slow
    Please please how to decrease the pool of memory?
    Anyone know?

    Hello
    Tic Tac Toe...
    they will just give you links, and they don't know how to give a good answer.
    Log in as the user sys.
    and do the following...

    1).SQL>create pfile from spfile;
    2).modify the pfile and decrease the size of pools.
    3).shutdown database.
    4). Startup database using created pfile.
    if it start ok and the SGA is lower.
    5.) Recreate the Spfile with the created Pfile.
    SQL>create spfile from pfile;
    

    It is the right way to respond.

    hope this helps you...
    Sarah

  • 5102na HP OMEN: how to disable the audio correction Bang &amp; Olufsen horrible?

    Is there someone who could tell me please how to disable the audio correction Bang & Olufsen? I'm sure that some people like it but I work with audio and I can't really how it changes the sound. I tried to open the Bang & Olufsen sign but I cannot unselect the correction in the section "listening experience", nor that I can change the associated equalization. Please someone help, thanks!

    I found a solution: http://h30434.www3.hp.com/t5/Notebook-PC-Sound-and-Audio/Beats-Audio-compression-and-volume-fluctuation-HP-ENVY-m6/m-p/5137867/highlight/true#M67144

    1. Go to the Windows Device Manager > sound, video and game controllers section.
    2. In the list of the audio device drivers, look for Realtek High Definition Audio. This is the device driver for BeatsAudio (a bit sneaky, wouldn't you say?).
    3. Right-click and select disable. Down arrow on this driver, indicating it is disabled. (NOTE: at this point, you will not be able to play music files.)
    4. Right click and select Update driver software.
    5. Select Browse my computer for driver software.
    6. Select Let me pick from a list of drivers for devices on my computer.
    7. You should see a window that says Select the driver to install for this hardware device. NOTE: If you see a window that says something like This is the best driver for this device, close the window and repeat steps 4, 5 and 6.
    8. In the scheme box, select Audio device high definition (this is the device driver audio substitute) and click Next.
    9. In the Update driver warning window, click Yes. You should see a confirmation with the high definition Audio Device display window. Click on Close.
    10. In the list of drivers of audio device in the section audio, video and game controllers, you will notice that the high definition Audio device now displays instead ofHigh Definition Audio Realtek.
    11. When prompted to restart, click Yes.
    12. Now enjoy your music with no compression!

    Thanks to SteveCT99

    This does not disable audio-Bang & Olufsen, but I just installed this EQ across the system instead: http://sourceforge.net/projects/equalizerapo/

    HP needs to release a driver which allow us access to the "Improvements" tab so we can turn off "Loudness equalization" (although "Loudness equalization" should not be on by default in the first place).

    The current driver is default.

  • Satellite A80: How to restore the audio and video codecs?

    How to restore the audio and video codecs that are installed by default on my Satellite A80 with XP Home edition?
    I removed the safe mode, due to a problem with the Pinnacle Codec installed by Pinnacle Studio 10.
    Now, I need to put the video standard in audio codecs.
    I already downloaded the Microsoft Mediaplayer codec package and video sound new fr in Media Player.
    Unfortunately I have always its program to diagnose Toshiba during the test of its Midi and Wave.
    System Restore came with the message that the restoration was not possible because no changes had been made.

    Post edited by: roel

    Hello

    Try to use the tool "system restore."
    This application restores the operating system to the beginning.
    Maybe it will work.

  • Satellite L655-1FO - how to install the audio driver?

    How to install the audio driver on my l655 1fo? I download the driver of toshiba, but it cannot start. Can someone help me how to install it on Windows XP. Thank you

    Hey,.

    Before starting with the installation of the driver it is important that you install Service Pack 3 for Windows XP, because it contains important updates for cards high definition sound. Otherwise, you are not able to install audio driver.

    Download & install SP3 and then you can start with the driver installation :)

  • How to upgrade the audio, video and game controllers on Windows XP Home Edition?

    Original title: SoundMAX Integrated Digital Audio

    How to upgrade the audio, video and game controllers on Windows XP Home Edition?

    I need SoundMAX Integrated Digital Audio

    Hello

    Why you trying to update the audio, video and game controllers?

    The following steps may be helpful:

    1. open the Device Manager.

    2. Locate the audio, video and game controllers and expand it.

    3 click the sound card, and then click Update driver.

    For more information: http://support.microsoft.com/kb/283658

  • How to activate the audio system

    original title: SYSTEM AUDIO OFF

    By mistake, I disable the audio device / speakers.  It's not ringing now. What should I do? help please... Thank you!

    Hello

    How to disabled the audio device?

    Run the troubleshooter and check.

    Open the troubleshooting of Audio playback

    Hope this information helps.

  • How to decrease the speed "duplicate"?

    How to decrease the speed "duplicate"? I use this script, but my eth0 show me 100 MB/s: run {allocate channel ch1 device type disk rate 10 m;}   allocate channel rates auxiliary ach1 devices type disc 10 m;   target database duplicate to dbtest02 of the active database. } What I did wrong?

    A transfer on the network will use all of the bandwidth is available. If you want to limit the consumption of bandwidth, check with the network team, if they can implement all controls using intermediate switches between the two servers.

    Hemant K Collette

  • How to modify the audio appearance when it is in an ePub document?

    Hi all

    I'm integrating audio content in my inDesign file in the "Advanced" design space, which will eventually become a fixed provision ePub file, then an eBook.

    However, when I place the audio file which works fine, I can not understand how to change the appearance of the 'media' window/Panel audio player built into inDesign. If I extend the framework to make it much bigger, a full audio bar (complete with controls), but it is very small. Alternatively, if I do the 60px banner frame by 60px banner, the audio bar is way shorter and apparently cut, but it is bigger and I can actually click on videos.

    Please check if it is all confused! It's a little hard to explain, so anyone with any input would be helpful. Thank you!

    I moved your question to the forum InDesign EPUB.

    You may have more luck if you create buttons to start and stop the audio. You can customize the appearance of the button because you can turn any shape or an object into a button. The Panel of buttons and forms to set up the button controls.

Maybe you are looking for