Flex 3 How to recording the voice to the local file.can u help sample souce code

How to recording the voice to the local file.can u help sample souce code

What? the link is not opening? Check once properly man.  If you need code here it is
import flash.system.Security;
import flash.media.Microphone;
import flash.events.ActivityEvent;
import flash.events.SampleDataEvent;
import flash.events.StatusEvent;
import flash.utils.ByteArray;
import flash.media.Sound;
import flash.events.MouseEvent;
import flash.media.SoundChannel;
import flash.events.Event;
import org.bytearray.micrecorder.encoder.WaveEncoder;
import flash.net.FileReference;
var mic:Microphone;
var soundBytes:ByteArray;
var recBytes:ByteArray= new ByteArray();
var sc:SoundChannel;
var sound:Sound;
recordBtn.addEventListener(MouseEvent.CLICK, getMic);
stopBtn.addEventListener(MouseEvent.CLICK, stopRecording);
playBtn.addEventListener(MouseEvent.CLICK, plays);
saveBtn.addEventListener(MouseEvent.CLICK, saveAudio);
function getMic(e:MouseEvent)
soundBytes= new ByteArray();
//returns an array that total mics available
var totalMics:Array = Microphone.names;
//mic is a singleton class gets microphone to record sound
mic = Microphone.getMicrophone();
//Sets the minimum input level that should be considered
mic.setSilenceLevel(0);
mic.rate = 44;
//to capture microphone audio listen for this event
mic.addEventListener(SampleDataEvent.SAMPLE_DATA, recordAudio);
function recordAudio(e:SampleDataEvent)
//capture the byte array data available with the event
while (e.data.bytesAvailable)
var soundData:Number = e.data.readFloat();
soundBytes.writeFloat(soundData);
function stopRecording(e:MouseEvent)
mic.removeEventListener(SampleDataEvent.SAMPLE_DATA, recordAudio);
//set the bytearray position to zero for playing from starting
soundBytes.position = 0;
function plays(e:MouseEvent)
//intatiazle sound instance
sound= new Sound();
soundBytes.position = 0;
//listen for the event when runtime requests new audio data.
sound.addEventListener(SampleDataEvent.SAMPLE_DATA, playAudio);
//play the sound with sound channel
sc = sound.play();
sc.addEventListener(Event.SOUND_COMPLETE, soundComplete);
function playAudio(e:SampleDataEvent)
//if audio bytes is greate than 4 read the recorded byte array data and write it into the sound
for (var i=0; i<8192; i++)
if (soundBytes.bytesAvailable > 4)
var sample:Number = soundBytes.readFloat();
e.data.writeFloat(sample);
e.data.writeFloat(sample);
function soundComplete(e:Event)
sound.removeEventListener(SampleDataEvent.SAMPLE_DATA, playAudio);
sc.stop();
function saveAudio(e:MouseEvent)
soundBytes.position = 0;
//waveencoder class used to encodes bytearray data properly used to play properly after saving
//you can get this api from below link
//http://code.google.com/p/micrecorder/downloads/detail?name=MicRecorder%201.2.zip&can=2&q=
var encod:WaveEncoder= new WaveEncoder();
var byte:ByteArray = encod.encode(soundBytes,2);
var file:FileReference= new FileReference();
file.save(byte, “test.wav”);

Similar Messages

  • HT204088 I forgot the security answer how I reset the answer ?can you help me please

    I forgot the security answer how I reset the answer ?can you help me please

    I forgot the security answer how I reset the answer ?can you help me please

  • How to pass the local file name to the workflow in TC OAWD

    Hi everybody!
    I have to pass the local file name of the image as a parameter to a workflow in TC OAWD.
    By debugging I found the FM which starts the workflow -  'ARCHIV_PROCESS_FAXINPUT' . It has two importing parameters : FRONTENDPATH and BASICFILENAME, but they are not used by calling the FM.
    Do you have an idea if there is a DDIC table, which contains the local file name or another way to solve the issue.
    Thank you in advance.

    Hi,
    Not sure of what you want.
    Have a look at v$session view. Machine column is maybe what you're looking for.
    If you want to retrieve the local host executing remote desktop, it's actually not possible natievely, since it's still remote host that is connecting to the database.
    Hope it helps.

  • How to get the local file system path of an image that loaded into the image component in cq5?

    Hi,
    I'm having hard time uploading image from filesystem where as drag and drop works.
    I'm not getting a path of image selected from filesystem.
    here is my code..
    private String populateImage() throws Exception {
                        if (currentNode != null && currentNode.isNode()) {
                                       Node ImageNode = JcrResourceUtil.createPath(currentNode, "image",
                                                                          null, "nt:unstructured", true);
                                       imageUrl = ImageNode.hasProperty("fileReference") ? ImageNode.getProperty("fileReference").getValue().getString() : "";
           imageUrl = imageUrl.trim();
            log.info("MANAGE PROFILE BEAN IMAGE URL INSIDE IF IS: " + imageUrl);
                        } else {
                                            imageUrl = properties.get("fileReference", "");
                                            imageUrl = imageUrl.trim();
                                            log.info("MANAGE PROFILE BEAN IMAGE URL INSIDE ELSE IS: " + imageUrl);
                        return imageUrl;
    So if I drag and drop..
    ImageNode.hasProperty("fileReference") is returning a valid path
    but if I upload an image  it is returning Null.
    So how to get the path? any suggestions around would be appreciated...

    When you say path you mean you want the path to print out in your HTML? Is that accurate? If so you generally need to constructe that path based on the path to the current component. So if you component is located at /content/mysite/en/about/mypage/jcr:content/parsys/image then the path to the image would generally be something like /content/mysite/en/about/mypage/jcr:content/parsys/image.img.jpg/1283829292873.jpg. The .img. selector triggers the servlet associated with the foundation parbase - /libs/foundation/components/parbase/img.GET.java. The reason you reference it this way is that there is no filesystem path to the image - it is stored in the repository not on the file system, and it requires a servlet or script to ge the binary from the repository and steam it.
    Normally the way you'd construct this is to use the out of the box Image class - so look at /libs/foundation/components/image/image.jsp. Now this example assumes that your component where you loaded the image extends /libs/foundation/components/parbase. If it doesn't then you either have to change your sling:superResourceType to /libs/foundation/components/parbase or some other component that does exten /libs/foundation/components/parbase.

  • How to convert the TEXT file into an XML using plsql code

    Hi all ,
    I need to convert an TEXT file into an XML file how can i do it
    Below is my sample TEXT file .
    TDETL00000000020000000000000120131021115854ST2225SKU77598059          0023-000000010000
    I want the above to be converted into the below format
    <?xml version="1.0" encoding="UTF-8"?>
    <txt2xml>
      <!-- Processor splits text into lines -->
      <processor type="RegexDelimited">
      <regex>\n</regex>
            <!--
            This is used to specify that a message should be created per line in
            the incoming file;
            NOTE: this was designed to work with all the processors, however it
            only works correctly with 'RegexDelimited' processors (check the
            enclosing top processor type)
             -->
             <maxIterationsPerMsg>1</maxIterationsPerMsg>
      <!-- For lines beginning with FHEAD (File Header) -->
      <processor type="RegexMatch">
      <element>FHEAD</element>
      <regex>^FHEAD(.*)</regex>
      <processor type="RegexMatch">
      <element>OriginalLine</element>
      <regex>(.*)</regex>
      <consumeMatchedChars>false</consumeMatchedChars>
      </processor>
      <processor type="RegexMatch">
      <element>LineSeq,Type,Date</element>
      <regex>^(\d{10})(\w{4})(\d{14})$</regex>
      </processor>
      </processor>
      <!-- For lines beginning with TDETL (Transaction Details) -->
      <processor type="RegexMatch">
      <element>TDETL</element>
      <regex>^TDETL(.*)</regex>
      <processor type="RegexMatch">
      <element>OriginalLine</element>
      <regex>(.*)</regex>
      <consumeMatchedChars>false</consumeMatchedChars>
      </processor>
      <processor type="RegexMatch">
      <element>LineSeq,TransControlNumber,TransDate,LocationType,Location,ItemType,Item,UPCSupplement,InventoryStatus,AdjustReason,AdjustSign,AdjustQty</element>
      <regex>^(\d{10})(\d{14})(\d{14})(\w{2})(\d{4})(\w{3})([\w ]{13})([\w ]{5})(\d{2})(\d{2})([+-]{1})(\d{12})$</regex>
      </processor>
      </processor>
      <!-- For lines beginning with FTAIL (File Tail) -->
      <processor type="RegexMatch">
      <element>FTAIL</element>
      <regex>^FTAIL(.*)</regex>
      <processor type="RegexMatch">
      <element>OriginalLine</element>
      <regex>(.*)</regex>
      <consumeMatchedChars>false</consumeMatchedChars>
      </processor>
      <processor type="RegexMatch">
      <element>LineSeq,TransCount</element>
      <regex>^(\d{10})(\d{6})$</regex>
      </processor>
      </processor>
      </processor>
    </txt2xml>
    Thanks

    Sorry, that doesn't make much sense.
    The XML you gave is a configuration file for txt2xml utility. It doesn't represent the output format.
    Are you a user of this utility?

  • How to convert the local file into unicode file?

    Hi All,
    I need read local file (GUI_UPLOAD) and save it as unicode file?
    I've found class CL_ABAP_CONV_OUT_CE but I've no idea how to use it.
    Should I read file in binary mode and then convert it into unicode? AT the and save it (GUI_DOWNLOAD) ?
    Thanks
    Adam

    Hi,
    Check these classes, will help you
    CL_ABAP_CONV_IN_CE : Reading binary data
    CL_ABAP_CONV_OUT_CE : exporting binary data
    CL_ABAP_CONV_X2X_CE : reading and exporting binary data and changing the format
    Regards,
    Satish

  • How to access the local files (Excelsheet) in bsp application

    Hi sdn,
    I created a bsp application my requirement is if i click the link it should display the excelsheet and if i perform any updations those updations will be modified int that excel sheet so can any one plz help me out in solving this issue.

    Hi,
    I think you shouldn't try to modifiy local files from a server application for security reasons.
    But, let's say you have your reasons.
    In your BSP, you have a link that points to an MS Excel file. Clicking this link will open the file in MS Excel and users will be able to modify and register it (and save the file in another path/name...).
    Another solution would be: create a table form (like ALV?) from the Excel file and save any modifications of the table form into the Excel file. Maybe HTMLB can supports such approach but I don't know HTMLB. I only use HTML and ABAP.
    All I said here is just overview of potential solutions. I'm not sure I exactly understood your need. Perhaps other Experts would have better answer for you.
    But I hope this will help you.
    Good luck!
    Thomas.

  • HT202213 I want to move my iTunes account on my macbook and my wife's iTunes accounts(PC) onto a network hard drive and share the music files, can anyone help?

    help

    Changing the setting as to where to store media will indeed put the media files (but not the rest of the iTunes library files) on the external drive as long as the user also selects to organize the media to the NAS.  If you don't do that, iTunes will only store new media there from that time on.
    I would not recommend keeping only media on the NAS.  As I said, NAS can have issues with iTunes and some of the longest topics I have seen here are how to rebuild a library after for some reason the library file on the Mac computer has lost the link information to the media files stored on a NAS.  Some things such as date added, play count, and ratings are only stored in the library file and may be lost if you have to rebuild your library file.
    I guess for me the only iTunes reason for having a NAS would be to do direct sharing of the library rather than having to use Home Sharing.  Direct sharing of the library intact requires placing all the iTunes files on the NAS. If you're going to do Home Sharing you might as well opt for a a cheaper, more stable, plain external hard drive.

  • How to upload the local file of the external sytem with same LAN

    HI
    My requirement is to upload a presentation server file (For ex: C:\test.txt) from the external system with in the same LAN into my sap (system)
    Thnaks in advance
    Mallik

    HI Roger
    My requirement is to upload a file from the other system into my system (both are with in the same LAN).
    Ex: two systems are there A and B (both belongs to same LAN)
    in A system's c drive one file is there ( i.e.: C:\test.txt)
    and iam using B system and i need to upload the file from the A system in SAP
    Please do help if u have clues

  • Temporary free access to InDesign CC - I'm signed up with Adobe but can't figure out how to access the InDesign download - can anybody help?

    Hi, I've registered for the free trial of Adobe Cloud in order to try out Indesign CC - but I can't get further than the "register new products" in my profile. I'm a complete beginner - please help!  Thanks.

    Hi solawista,
    Please find the download instructions in the link below.
    Creative Cloud Help | Install, update, or uninstall apps
    If you face any sort of error refer the link below.
    Troubleshoot Creative Cloud download and install issues
    Thanks,
    Atul Saini

  • How to record my voice by headphone on mac mini

    Hi all,
    How to record my voice by headphone on mac mini. The headphone have a microphone. It can record on window 7, but on mac mini, it's not working.
    I don't know why. Please help me.
    Thanks.

    Open Quicktime Player
    File Menu: New Audio Recording....
    However... if the headphone/microphone combination has two 3.5mm jack plugs (pink and green) then the microphone output (pink) is "mic.level" - which is TOO QUIET for the audio input on a Mac, which is expecting the much stronger "line.level" signal strength.
    Solutions: get a microphone pre-amplifier between the mic and the Mac (not cheap); or a different microphone with a USB interface.

  • How to record the screen in snow leopard ?

    how to record the screen in snow leopard ?

    Must I find it myself !
    Well you could try Google :-)
    I am unsure if you want a static image, or a movie recording of what you are doing on your screen.
    Images can be done using Command-Shift-3, Command-Shift-4, and Command-Shift-4-Space.
    3rd party utilities such as Skitch will allow you to annotate the image after you capture it.
    Making a movie of your screen activities can be done usng Applications -> Quicktime
    There are 3rd party screen records such as Snapz Pro, ScreenSteps, etc...
    And of course you can do a Google search.

  • How to create the SWF file which was included surrogate pairs.

    I would like to make sure how to create the SWF file which are included surrogate pairs.
    The error of outside the scope of unicode occurred when I compiled(mxmlc) the as file which was set surrogate pairs to 'Unicoderange'.
    Ex, I set the '  '(UTF-16 is '20B9F') to 'Unicoderange'.
    However, I cannot add the surrogate pairs.
    The error of outside the scope of Unicode occurred when I compiled the AS file.
    The reason of error was that the Unicode(UTF-16) of surrogate pairs is invalid.
    Then, I read the following pages.
    These pages are written that unicode-range supported surrogate pairs.
    http://livedocs.adobe.com/flex/3/html/help.html?content=fonts_07.html
    http://www.w3.org/TR/1998/REC-CSS2-19980512/fonts.html#descdef-unicode -range
    So please let me know how to create the SWF file which are included surrogate pairs.
    Environment
    - Flex3.5a
    - TTC: meiryo(ver6.02), msgothic(ver2.50), mspgothic(ver2.50)
    Thanks,
    Takeshi Ishihara.

    I've been able to create project jar files in Eclipse by selecting Export from the File menu, then choose Java - Jar file - and provide the required information, name, destination folder etc. But when I do this, I do not export other jars on the build path this way nor do I expect to do this. I am only concerned with creating a jar file of my own work. A jar file does not "contain" other jar files. If the jar file contains the main method, and requires other jars for it's execution, then you may wish to include a reference to required jars on the class path entry of the Manifest file of the jar file you create. I'm not sure how to create a Manifest file in eclipse though..

  • How to extract the cobol files into owb

    Hi
    How to extract the cobol files in owb,I am using OWB9.2.
    Ex:I am having 2 records DCEC4000100 9159000050C those values are 5 bytes 'RAVI and 6 bytes '15000'.
    Using contorl file i am trying to load these into Oracle,But i am not able into insert these records into Oracle.
    Can any tell me how to handle this kind of situation?
    Regards,
    Rupak

    Good morning Ashok,
    Your data is in a SQL*Loader supported datatype, so basically it should not be a problem.
    Have you checked the Database Utilities guide (for Oracle9i for instance: http://www.lc.leidenuniv.nl/awcourse/oracle/server.920/a96652/toc.htm) on how to handle this?
    I'll also repeat my previous question, have you ever been able to load data into the database using SQL*Loader (either using ASCII values or any other datatype)?
    For the OWB part, have you read "Importing Data Definitions" (typically chapter 4)? More specifically, "Specifying Field Properties" in "About Flat File Sources and Targets"?
    In "SQL*Loader Properties" it says the following:
    Type Describes the data type of the field for the SQL*Loader. You can use the Flat
    File Sample Wizard to import the following data types: CHAR, DATE, DECIMAL
    EXTERNAL, FLOAT EXTERNAL, INTEGER EXTERNAL, ZONED , AND ZONED
    EXTERNAL. For complete information on SQL*Loader field and data types, refer to
    Oracle9i Utilities. Currently, only portable datatypes are supported.
    If you check the database utitlities guide (chapter 6 Field List Reference) and look for "SQL*Loader Datatypes", you'll find (packed) decimal under the Nonportable Datatypes. This implies that OWB does not support it.
    This does not mean you can't use SQL*Loader, you'll only have to define everything separate from OWB and call it separately as well.
    Good luck, Patrick

  • How to see the .AS file that .MXML file is translated to before being compiled to SWF?

    I am trying to dynamically load some other Applications in
    one Application, use ActionScript but not SWFLoader tag, it looks
    like:
    <mx:Application>
    <mx:Script>
    <![CDATA[
    private var loader:SWFLoader = new SWFLoader();
    private function loadSWF(url:String):void{
    var baseURL:String = this.url.substr(0,
    this.url.lastIndexOf("/"));
    var url = baseURL + "/"+ name;
    //even if I did not add any event listener!
    loader.load(url);
    ]]>
    </mx:Script>
    <mx:Button label="B" click="loadSWF('Top_2.swf');" y="10"
    x="58"/>
    </mx:Application>
    then when me click the button, always occured an error like
    this:(even if every method I add try...catch... )
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at mx.core::UIComponent/
    http://www.adobe.com/2006/flex/mx/internal::updateCallbacks()[E:\dev\3.0.x\frameworks\proj ects\framework\src\mx\core\UIComponent.as:5043
    at mx.core::UIComponent/set
    nestLevel()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:2522]
    at mx.managers::SystemManager/
    http://www.adobe.com/2006/flex/mx/internal::addingChild()[E:\dev\3.0.x\frameworks\projects \framework\src\mx\managers\SystemManager.as:1583
    at
    mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\3.0.x\frameworks\projects\fr amework\src\mx\managers\SystemManager.as:2481]
    at mx.managers::SystemManager/
    http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()[E:\dev\3.0.x\frameworks\proj ects\framework\src\mx\managers\SystemManager.as:2330
    however, if I use <mx:SWFLoader source="Top_2.swf" />
    tag, there is no such problem! So I think it must be I didn't init
    SWFLoader correctly!
    I hope someone can tell me how to crrect this mistake
    directly, but I more wish someone to tell me how to view the .as
    file that the .mxml file translated to before being compiled to a
    SWF( If there is a such step!)
    Thanks!

    Maybe the SWFLoader must be one child of one DisplayObject!??
    I found when the swfloader is been added to some
    DisplayObject in actionScript like below, the problem didn't occure
    any more.
    swfloader.visible = false;
    this.addChild(swfloader); // 'this' is current Application
    swfloader.addEventListener(".....", someHandler);
    swfloader.load("someurl");
    Why? Is this a bug or not?
    I am still waiting someone to tell me where a .mxml file can
    be translated to a .as file which could be visited!

Maybe you are looking for

  • Assigning a Character in a String

    Looking to assign a character in a string but it looks like charAt is read only? Ideas?

  • Error in Shared Services

    Hi Alll, I am using EPM System 11.1.1.1.0 . When i log in to Shared services and try to create users i get the following servlet error on the second page where i want to assign "Group Membership" .... *"The current application deployment descriptors

  • Random NullPointerException on resultset.getstring

    I have been getting random NullPointerException ever since I have moved my code to a new dev server. I was using tomcat 3 and oracle 9i but moved to tomcat 6 and oracle10g express edition. The errors happen mostly when the server is under load. here

  • How to integrate with Lightroom?

    I'm having some trouble trying to understand the proscribed alternative method for integrating Lightroom with Revel (which I subscribe to). After months and months of smooth operation, Lightroom is suddenly telling me my Revel plug-in is missing, but

  • Disable Transfer Order Automatically/Immediately

    Dear All, May i know how to disable the TO automatically/immediately in Lean Warehouse. This is because, when i save the Outbound Delivery in VL01N, it will automatically generate the TO. Can i disable this function and create the TO manually? Thank