Streaming Audio and playback

Hello

In my application, I tried to record audio and then tried writing the bytes on the file system in mp3 format. When I open the file via the browser recorder opens and it does not play anything. I'm doing something wrong?

(FYI: JDE 4.6 Simulator 9000)

import java. IO;
Import javax.microedition.io.Connector;
Import javax.microedition.io.file.FileConnection;
Javax.microedition.midlet import. *;
Javax.microedition.lcdui import. *;
Javax.microedition.media import. *;
Javax.microedition.media.control import. *;
Import net.rim.blackberry.api.browser.Browser;
Import net.rim.blackberry.api.browser.BrowserSession;
Import net.rim.device.api.applicationcontrol.ApplicationPermissions;
Import net.rim.device.api.applicationcontrol.ApplicationPermissionsManager;

SerializableAttribute public class RecordMIDlet extends MIDlet {}

public void startApp() {}
Display.getDisplay (THIS) .setCurrent (new RecordForm());
}

public void pauseApp() {}
}

{} public void destroyApp (boolean unconditional)
}
}

class RecordForm extends form implements {CommandListener}

Private StringItem messageItem;
Private StringItem errorItem;
private final order recordCommand, playCommand, cameraCommand;
Private player p;
Private byte [] recordedSoundArray = null;

public RecordForm() {}
Super ("Audio recording");
messageItem = new StringItem ("Record", "Click record to begin recording.");
This.Append (messageItem);
errorItem = new StringItem ("", "");
This.Append (errorItem);

recordCommand = new command ("Record", Command.SCREEN, 1);
this.addCommand (recordCommand);
playCommand = new command ("Play", Command.SCREEN, 2);
this.addCommand (playCommand);
cameraCommand = new command ("camera", Command.SCREEN, 3);
this.addCommand (cameraCommand);
StringBuffer inhalt = new StringBuffer();
this.setCommandListener (this);
}

' public void commandAction (command comm, viewable disp) {}
If (comm == recordCommand) {}
checkPermissions();
New Thread (new Runnable() {}

public void run() {}
try {}
p = Manager.createPlayer ("capture://audio?encoding=pcm");
p.Realize ();
RecordControl rc = p.getControl("RecordControl") (RecordControl);
ByteArrayOutputStream output = new ByteArrayOutputStream();
rc.setRecordStream (output);
rc.startRecord ();
p.Start ();
messageItem.setText ("recording...");
Thread.Sleep (5000);
messageItem.setText ("done!");
RC.Commit ();
recordedSoundArray = output.toByteArray ();
p.Close ();
saveMedia ("recordTest", recordedSoundArray);
} catch (IOException ioe) {}
errorItem.setLabel ("Error");
errorItem.setText (ioe.toString ());
} catch (MediaException me) {}
errorItem.setLabel ("Error");
errorItem.setText (me.toString ());
} catch (InterruptedException ie) {}
errorItem.setLabel ("Error");
errorItem.setText (ie.toString ());
}
}
({. start()});
} ElseIf (comm == playCommand) {}
Play();
ByteArrayInputStream recordedInputStream = new ByteArrayInputStream (recordedSoundArray);
Drive p2 = Manager.createPlayer (recordedInputStream, "audio/basic");
P2. Realize();
P2.prefetch ();
P2. Start();
} ElseIf (comm == cameraCommand) {}
Camera.getInstance () .showCamera ();
}
}

{} public void play()

New Thread (new Runnable() {}

public void run() {}
Private private = Browser.getDefaultSession ();
browserSession.displayPage("file:///SDCard/recordTest.mp3");

}
({. start()});

}

' Private Sub saveMedia (fileName As String, byte [] data) survey IOException, SecurityException {}
String imagePath = "SDCard /";
FileConnection fileConnection = null;
DataOutputStream dataOutputStream.

Connection string = "file:///" + imagePath + ".mp3" fileName
System.out.println ("path of Conn:" + connection);

fileConnection = Connector.open (connection) (FileConnection);
If (! fileConnection.exists ()) {}
fileConnection.create ();
}
dataOutputStream = fileConnection.openDataOutputStream ();
dataOutputStream.write (data, 0, data.length);
dataOutputStream.flush ();
dataOutputStream.close ();
If (fileConnection! = null) {}
fileConnection.close ();
}
}

private void checkPermissions() {}

APM ApplicationPermissionsManager = ApplicationPermissionsManager.getInstance ();
Original ApplicationPermissions = apm.getApplicationPermissions ();
If (original.getPermission (ApplicationPermissions.PERMISSION_RECORDING) == ApplicationPermissions.VALUE_ALLOW) {}
return;
}
ApplicationPermissions permRequest = new ApplicationPermissions();
permRequest.addPermission (ApplicationPermissions.PERMISSION_RECORDING);
acceptance of Boolean is ApplicationPermissionsManager.getInstance () .invokePermissionsRequest (permRequest);.
If {(acceptance)

The user accepts all permissions.
return;
}
}
}

Thanking you,

Kind regards

S.A.Norton Stanley

Hello

The problem was that I was starting the browser in a thread that was causing the problem. It works fine now.

Thanking you,

S.A.Norton Stanley

Tags: BlackBerry Developers

Similar Questions

  • How to make a streaming audio and video on BlackBerry.

    Hi all

    Please someone help me.

    I must be a 3rd part java application that can stream audio and video server and can play only audio/video on my phone from BB.

    Please share me your ideas or related links to do the same as soon as POSSIBLE.

    Thanks in advance.

    Thanks Peter.

    It's really useful links

  • Audio and playback are faster they are supposed to play.

    Hello

    I had serious problems with the overall reading. My boyfriend and I are doing a day-shoot and are currently working on two PCs. Overall, we did a universal model for our project and shooting 24 images per second. The problem is that my PC playback moves faster / is rough than the real shot. My audio is well outside the first with my hardware. Everything is up-to-date. I uninstalled and installed two different moments, clean the cache, checked the cameras and sequences and am at a loss. Help would be appreciated.

    You probably have variable frame rate video and first do not like that.  If that's true then you need to convert it to a constant rate.  See "HandBrake".

  • Streaming Audio and video

    I'm looking to see what outgoing ports and incoming, I need to block for this 'feature of the internet' unavailable. I want to block these ports. Does anyone know what are the ports they are or where I can find them?

    Hello

    Search ports used by H323. In particular these ports should be blocked 1720/tcp/udp, udp/1718, 1719/udp

    Click on the following link for more information

    http://www.BCR.com/bcrmag/2002/07/P10.asp

    Thank you

    Nadeem

  • Unable to save the Streaming Audio / Creative xfi extreme audio/windows 7

    Creative xfi extreme audio and Windows 7.

    I tried everything and can not record audio streaming. tried to use hearing, audacity and in the audio recording window.
    Drivers day and are tired of all the configurations.
    A post I read online said that Creative didn't activate this option.
    Any suggestions or hacks that you can think...
    Scott

    You can save "what you hear" XP for sure.

    If you do not have this option in the Blender of W7 so you are right, its been disabled.

    However, there is a work around.

    You must create a virtual audio device on your PC. Google for "streaming audio" and you will find some solution, some software are free, others pay.

    Once you have chosen and installed the software, then use the virtual audio device to play the streaming audio and record its 'exit' in your Xfi.

    It is a different and more complicated using two sound devices - your audio device shipped along with your Xfi. Their implementation is not easy, but basically if you got theml work, you will need to connect a cable from the line from one to the line in the other. However, I do not recommend this at all. The software is much more simple.

    See you soon,.

    Jerry

  • Qosmio F60: audio and video distortion during playback of a media file

    Qosmio f60 / win 7 64 bit / 8 GB ram / 1 GB video card...
    Purchase date: June 2011

    question: audio and video distortion during playback of a media file

    of fact steps:

    (1) updated drivers audio & video > update bios > sent to Toshiba UAE; reformatted > replaced speakers; same CPU > (more funny when im not connected online using wifi, everything is good and ok) > dealers replaced wireless nic > No. SUCCESS still questions...

    (2) being researched a few discussions > reinstalled the drivers SATA > IRST update of intel > no still no chance > uninstalled TSRI > used Mirosoft AHCI > HDD and PC health monitor update > disabled all the > always unlucky (this solution came from TOSHIBA himself of their technical knowledge base)

    Resellers cannot identify the problem... I followed the technical knowledge base and still not solved...

    CAN SOMEONE PLEASE HELP ME SOLVE THIS ANNOYING PROBLEM? IT BECOMES NOWHERE >

    Toshiba tech support, please help me to solve this issue... I just bought recently and I didn't like that at all. It is not worth...

    > more funny when im not connected online via wifi, everything is good and ok
    Does this mean that this problem appears only using the WiFi network?
    Hmm how about Wlan driver update? Try this.

  • LifeCam HD-6000 wrong with the audio and video lag during playback, also a problem with the autofocus.

    I have a Lifecam HD-6000 laptop. Since the first day, I had trouble with the audio and video lag during playback. It cuts sometimes several seconds each time. Any program I opened to view it. Windows Media Center, Real Player, Media Player Classic, etc.

    There is also a problem with the autofocus. It will randomly in and out of focus, more spoil videos that I do. Any help with all these problems? I've updated all audio cards, drivers, etc. I am running Windows Vista.

    Thank you.

    Hi thebuell4,

    ·         Did you do changes on the computer before the show?

    Follow these methods.

    Method 1: Perform a clean boot to see if there is a software conflict as the clean boot helps eliminate software conflicts.

    Note: After completing the steps in the clean boot troubleshooting, follow the link step 7 to return the computer to a Normal startupmode.

    Method 2: Install the latest software/drivers for the lifecam.

    http://www.Microsoft.com/hardware/en-us/d/LifeCam-HD-6000-for-notebooks

    Method 3: Follow the steps in the article.

    Image of LifeCam guard auto setting very frequently

    For reference:

    The problems of compatibility between LifeCam and other programs

  • Since the update "-Audio and Microsoft, Communication device, Streaming Media Broadcast" webcam does not work? ___Installation status: Successful___Update type: Recommended___Microsoft Audio, device communication, Media Streaming and Broadcast__

    Microsoft LIFECAM-VX 5500 Help! Since the update "-Audio and Microsoft, Communication device, Streaming Media Broadcast - Microsoft LifeCam VX-5500" it has not worked. The program does not open and when I try it says "stopped working". Also, when in MSN Messenger it freezes it and nobody can see me nor can I see myself. What can I do to fix this? I know it's the update because it worked perfectly before, and I read of others having this problem. Help!

    Hi john.w.11,

    I suggest you to install the latest driver for VX-500 that could help you solve the issue.

    Click on the link below for more information.
    Troubleshoot failures to find the new LifeCam hardware
    http://support.Microsoft.com/kb/929087

    Check whether the problem is resolved.

    Please post back and let us know if it helped to solve your problem.

    Kind regards
    KarthiK TP

  • audio interruptions every 30 seconds on WAV recording AND playback - computer laptop Dell 1545, Windows 7

    Recently (the last couple of weeks), my laptop Dell 1545 with Windows 7 started having a problem: when I record or reading any WAV file (or a file MPG or WMV video too by the way) with any application (I tried several), there is a stuttering or interruption every 30 seconds like clockwork.  I have tried everything and can't seem to fix it.  During playback, it causes a split second buzz or silent, on the record, missing just a fraction of a second of audio, leaving a 'leap' in the best stuff WAV audio recording.  The only changes that I made in the system in the past month have been a few updates to Windows 7.  It ruins any recording or playback, I try to do, and is very frustrating.  It does the same thing on the files that are years old and new files (reading).  If I burn these files to a CD or DVD, they play very well in the CD drive or DVD, is not a problem in the files (except those currently record during breaks).

    What I tried:

    Much, restart several times.

    Reinstall the driver for my audio interface, even if she did the same on the native sound card too.

    Download the new driver from the audio interface and install it.

    Back to the old driver, then again to the new.

    Tried to record from multiple sources, ditto.

    I tried recording through the native as well as audio interface sound card.

    Deleted 40 GB from my hard drive.

    Defragged my hard drive

    Off my anti-virus program

    Close all other programs other than playback of the file.

    All USB disconnected elements.

    Tried to plugged the charger and entirely on batteries.

    RAM tested.

    Tested CPU.

    Nothing has worked so far.

    Any ideas?

    DWasnich: I had the same problem as you yesterday after restoring my Dell Inspiron 1545 to factory image. Through process of elimination (as mentioned Gokul T) I was able to determine that one of the services was originally the audio and video to jump to 30-second intervals. I disabled the 'Intel Matrix Storage Monitor' service and solved the problem. Why this service was installed and running after the factory reload is confusing. This is one portable hard drive without needing a RAID System. I hope this has solved your problem too! Joe

  • My system hardware and audio changes playback stops suddenly. What can I do?

    My system hardware and audio changes playback stops suddenly.

    I ' v tried checking device in the Device Manager, it appears as properly installed and a sound test is attempted it says that it is used by another device.

    When the problem arises, I go to the Device Manager and do a right click on the device, then I click where it says 'Search the hardware changes' and then it starts working again, but for 5-10 minutes. Tops.

    Please help me...

    Hello

    1. What is the brand and model of the PC?

    2. are you aware of any hardware or software of the PC prior to this problem?

    3. is there another audio device connected to the system?

    This happens usually if the audio output settings are incorrect or if another audio device is attached to the system such as a complement for the audio card.

    Kindly, follow these methods and check if that helps.

    Method 1:
    Similar issues were corrected by restarting the Windows Audio service.

    Follow these steps:

    a. press the Windows key + R, type run and press Enter.

    b. type services.msc and press ENTER.

    c. scroll to find Windows Audio and Windows Audio Endpoint Builder services.

    d. do a right click and Properties, stop and start the services.

    e. click on apply and OK.

    Check the result.

    Method 2:
    You can turn on the speakerphone as default output device and check the result.
    Follow these steps:

    a. press the Windows key + X, choose CControl Panel.
    b. click on the its, a new window will open.
    (c) in the new window, click the read tab.
    d. right-click on the speakers and select set as default.

    f. click apply and OK.
    Check if it helps.

    Let us know the result. If you have any other questions, we will be happy to help you.

  • My audio and video playback stutters in cc pro 2015.

    my audio and video playback stutters in cc pro 2015.  It complies with the source, or the window of the program.  Continues even if my project is rendered.

    Win 10 64.

    2 x xeon x 5675,

    Quadro 6000,

    48 GB RAM,

    2 128 gb SSDS as a RAID 0 256.

    Is it because I only have the disk for the storage and the OS/software?

    [title published by mod]

    Try to change the entry to zero.

    If you want to continue to use the release of the nVidia card, try to remove the sound card completely.

  • DVD ROM audio and video playback jerky/stuttery

    Hi all

    My first post and I'm rather puzzled.

    This problem just - I went to play a DVD (real DVD, not burned) in my laptop and playback was stuttery, audio and video.  Never noticed before, but is now constant.

    I have run all software troubleshooting and even checked this forum for solutions.  The most common seems to be to check if DMA is enabled, and it is.  I tried several video players (VLC, media library, WMP11) and the problem exists on each of them.  I checked to make sure that all drivers are up to date, and they are.

    I have an Inspiron E1705, 2,00 ghz core2duo, 1 GB of RAM.  The DVD player is a DVD + RW SDVD8820 Phillips.

    Ideas?

    Any suggestions would be helpful and appreciated.  Thanks for reading!


  • Windows xp, Windows media player from Windows no audio, and audio playback including the itunes window media?

    Microsoft Fix it convenience store! Detected a new hardware - Multimedia Audio Controller > Intell (r) 82801BA/BAM AC 97 - a problem

    is produced during the installation, the new material did not properly installed?, vurnerable to all devices on the computer, it is now also

    Windows did not recognize the other sounds driver audio and what sound card is not in the dxdiag.exe.check system! No sounds?

    Happy! I need assistanced for this problem?

    Hello

    1 how long have you been faced with this problem?
    2. don't you make changes on the computer before this problem?
    3. What is the brand and model of the computer?

    See the following article for update check and sound card driver so that solves this problem.
    How to update a sound card driver in Windows Vista and Windows XP
    http://support.Microsoft.com/kb/166774

  • Windows Media Player-audio and video freezes during playback

    FREEZE AUDIO AND VIDEO IN WINDOWS MEDIA PLAYER OR VLC MEDIA PLAYER

    FREEZE AUDIO AND VIDEO IN WINDOWS MEDIA PLAYER OR VLC MEDIA PLAYER WHILE THAT WATCHING VIDEOS.  WHEN THE IMAGE AND THE SOUND HANGS, THERE IS A DULL NOISE.  THIS FREEZING HAPPENS ON EVERY MINUTE OR SO.  THAT HE IS PAST JUST STARTED ABOUT 3 DAYS AGO.  BEFORE THAT ALL WAS WELL WITH THE PC AND WATCH VIDEOS.  I RUN A FULL WITH MICROSOFT ESSENTIALS SCAN AND SAYS THAT SOME THREATS NOT FOUND.  I REBOOTED, DEFRAGGED, REMOVED THE POWER CORDS, ETC. WITHOUT SOLUTION.

    PLEASE ME TELL HOW I CAN STOP THIS PROBLEM?

    FREEZE AUDIO AND VIDEO IN WINDOWS MEDIA PLAYER OR VLC MEDIA PLAYER WHILE THAT WATCHING VIDEOS.  WHEN THE IMAGE AND THE SOUND HANGS, THERE IS A DULL NOISE.  THIS FREEZING HAPPENS ON EVERY MINUTE OR SO.  THAT HE IS PAST JUST STARTED ABOUT 3 DAYS AGO.  BEFORE THAT ALL WAS WELL WITH THE PC AND WATCH VIDEOS.  I RUN A FULL WITH MICROSOFT ESSENTIALS SCAN AND SAYS THAT SOME THREATS NOT FOUND.  I REBOOTED, DEFRAGGED, REMOVED THE POWER CORDS, ETC. WITHOUT SOLUTION.

    PLEASE ME TELL HOW I CAN STOP THIS PROBLEM?

    =======================================================
    It might be worth a try to do a system restore in time before the beginning of the question.

    (306084) how to restore Windows XP to a previous state
    http://support.Microsoft.com/default.aspx?kbid=306084

    Volunteer - MS - MVP - Digital Media Experience J - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • Windows 7 suddenly agitated developed audio and video playback after a week of everything fine

    I don't know if this means that my HARD drive is going bad on this new generation, or if something got screwed in place in Windows 7?

    Until yesterday, everything was pretty much OK for a week.  Last night, however, I started to develop audio and video ground.  Today, when I went to start, the computer hung on Beeeeeeep I turn it off and restart again.  I have still the video choppy.  I tried some diagnostic program of my Western Digital Green 1 TB 1 week drive HARD drive, and a quick test that was supposed to take 2 minutes estimated was still underway after nine minutes when I cancelled it.  It found no errors up to this point, however.

    Processor: Core i5 750
    My motherboard is an Asrock P55m Pro
    HARD drive: Western Digital Caviar Green 1 TB
    4 GB Ram 1333 Gskill
    Gigabyte 4550 video card

    I tried to roll back the audio driver and reinstalling one that worked, but no help.
    Tried to install the latest video driver, but no help there either.
    Tried to adjust the power of savings in the bios settings, but no luck

    I see many others have trouble with Windows 7 doing audio choppy, but they seem to be running realtek audio. Mine is VIA.

    Any advice/help/suggestions?

    Thank you.

    Okay, I went back and did another system restore to an earlier date, and everything was going well for a few boots.  Then she went and made a few updates, and the problem came back.

    The problem seems to grow after an attempt to install the following updates through Windows Update (and fails after every restart):

    1 - other hardware - Microsoft HID Non-User Input data filter (KB 911895)
    2. definition update for Windows Defender - KB915597 (definition 1.69.301.0)

    Other things, that he did...

    3. I have a Microsoft Lifecam VX-5000, and installed the software for it because I changed the USB port
    4. I had several errors with my Microsoft Wireless Multimedia Keyboard 1.1 and mouse.  I had to disable these updates last week, because they never properly install and keep trying to reinstall on each reboot:

    5. Microsoft - Input - Microsoft USB double receiver wireless keyboard IntelliType Pro)
    6. Microsoft - Input - Microsoft wireless receiver double USB mouse (IntelliPoint)

    Cripes, I bought Microsoft Products assuming that they would work well with Windows, and BOY was I wrong!  I got that grief of this keyboard, here and on XP prior agreement.

Maybe you are looking for

  • Satellite Pro A10 - question memory & overall sluggishness

    Two questions really, even if they may be related. 1. I have an A10 (XP / IT with a Celeron 2.2GHz processor & 256 MB installed RAM) that runs now very slowly - extremely laborious. Do all the usual things (defragmented, spyware scanning, virus scann

  • Satellite T130 - no recovery disk

    Hello Windows 7 no longer works on my machine and I did not create a recovery disk. Can I ask Toshiba to provide a recovery CD that I can use to create a USB bootable since Toshiba T130 doesn't have a CD player? Thank you Andrea

  • H8-1114: h8-1114 bad upgrade to Nvidia 740

    Hello I was wondering what I'm doing wrong, or if the card is even compatible with the computer...

  • Cumulative update for Windows Vista...

    There are several updates, called "Cumulative Security Update for Windows Vista" that whenever I have download interrupts me to use Internet Explorer 7. I have no problem download from this but find myself constantly having to uninstall these updates

  • fix security xp window 822603 Q

    Sir, I have a sony FW12M/B notebook with operating system WINDOWS VISTA HOME PREMIUM SERVICE PACK 1. But whenever I try to install new software, it pops up a window displaying a message that you need to install WINDOWS XP SECURITY HOT DIFFICULTY Q 82