Skip to main content
Participant
March 18, 2009
Question

Browser based Voice Recorder

  • March 18, 2009
  • 2 replies
  • 2090 views
Hi,
I am trying to create browser based voice recorder in flash to capture user voice and save the files in the server.
Can you please suggest any way how can i create the same.
    This topic has been closed for replies.

    2 replies

    March 19, 2009
    Visit FMS devnet page for beginner articles & sample code. Following link contains a tutorial for "Record Audio & List"

    http://www.adobe.com/devnet/flashmediaserver/sample_apps.html



    Participant
    March 23, 2009
    Thanks for the sample code link.

    I have downloaded the file from Record Audio & List.
    I have kept the file in htdocs inside the folder record and changed the connection path.

    But I am unable to record any audio from the microphone.
    neither it is creating any sound file .
    The code is as follows:

    //#include "NetDebug.as"

    // Attach the video device output from 'client_cam'
    // to the 'Live_video' video clip. Also get the default microphone
    client_cam=Camera.get();
    client_mic=Microphone.get();
    Live_video.attachVideo(client_cam);

    function initStreams() {

    // Make a connection to the application on the server
    client_nc = new NetConnection();

    // Handle status message
    client_nc.onStatus = function(info) {
    trace("Level: " + info.level + newline + "Code: " + info.code);
    }

    client_nc.connect(" http://localhost/record");

    // Create output stream
    out_ns = new NetStream(client_nc);

    //set a small buffer
    out_ns.setBufferTime(5);

    // Create input stream
    in_ns = new NetStream(client_nc);

    //set a small buffer
    in_ns.setBufferTime(5);

    Replay_video.attachVideo(in_ns);

    }

    // Connect to server and set up streams
    initStreams();

    function doRecord() {

    if (Record_btn.getLabel() == "Record") {

    // Start publishing the camera output as a recorded stream
    out_ns.attachVideo(client_cam);
    out_ns.attachAudio(client_mic);
    out_ns.publish("new_sound", "record");

    // Don’t allow the user to play when recording
    Play_btn.setEnabled(false);
    mic_txt.text = client_mic.name;
    // Change the button label
    Record_btn.setLabel("Stop");

    } else if (Record_btn.getLabel() == "Stop") {

    // Close output stream
    out_ns.close();

    // Now that you’re finished recording, allow the user to play
    Play_btn.setEnabled(true);

    // Change the button label
    Record_btn.setLabel("Record");

    }
    }

    function doPlay() {

    in_ns.play("new_sound");

    }


    Kindly let me know what i need to change in the code to make the things work.

    Participating Frequently
    March 18, 2009
    If you have created the application and it works, I guess embedding it in a web page is all thats required. SWFObject is a good way to embed your swf in any webpage - except I've missed the point of your post
    Participant
    March 19, 2009
    I think i could not clarify properly what i want .
    I want to create browser based voice recorder,and want some idea regarding the same