Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.


Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: Record/Save Audio with Flash Media Server

  1. #1

    Record/Save Audio with Flash Media Server

    Hello everyone,
    I'm trying to record audio from my microphone and save it out as an .FLV or .MP3 (or any other kind of audio format) file. I've gathered from my research that I need Flash Media Server which I do have access to but that's pretty much where the trail has stopped.

    I'm unable to find any concrete examples of doing this and would really appreciate if someone can point me in the right direction. I can use either AS2 or AS3 and this is agency work so I've got a pretty good set of tools at my disposal, just need to get somewhere with the research.

    Has anyone done something close to this before or have seen anything on the topic?

    Thanks GREATLY for any help that is offered.

  2. #2

    Me Too!

    I'm trying to do the same thing, so I'm hoping someone steps forward with some suggestions, or at least a website example so we know it actually can be done.

    FYI, there's another thread here on the Kipura forum that touches on the subject, though not as definitively as I may have liked...



  3. #3
    Are you trying to save the sound onto the FMS server or locally?

    I've come up with a solution to save it onto FMS but I'm having what I believe is a microphone issue so I'm unable to see if it works yet. I should have something more concrete in the next couple of days at which time I'll post the solution on my blog so hopefully it'll solve all of our problems.

    i'm using the dev version of FMS on my PC laptop.

  4. #4
    Quote Originally Posted by mprzybylski View Post
    Are you trying to save the sound onto the FMS server or locally?
    Locally would be great, since we don't yet have our Flash Media Server up and running. If that's not possible, using the FMS route is fine too, I just wouldn't be able to set it up until the end of this month.

    If you've got a working prototype, I'd love to see it!

    Keep me posted, won't you?



  5. #5
    I've went ahead and posted my source file. Please read the whole blog post first to understand it.


  6. #6
    Thanks for posting that!

    However, we're still a month or so away from having our Flash Media Server up and running. Do you have a working example of this set up anywhere where I can see it up and running, (or more importantly, where I can show my supervisors that this concept actually works!).



  7. #7
    no Mike, as this was running on Flash Media Server developer edition (which is free and runs on your local PC only). I did write a "tutorial" on how to set up FMS developer edition on your local machine, which you can read here:


    and then you can play with the example and show them a working version. hope that helps.

  8. #8
    Great, that looks promising. I'll give that a shot. Thanks a ton for your help!

  9. #9

    The example did help me understand how to record and play flv files from FMS but can provide me with some example for playing an mp3 file from FMS.

    I wrote a small class :

    package {
    import flash.media.*;
    import flash.events.*;
    import flash.net.*;
    import flash.utils.Timer;

    public class SoundControl {
    public var sound_url:String=new String();
    private var connection:NetConnection;
    private var stream:NetStream;
    private var time:Timer;
    function SoundControl() {

    public function set songUrl(url:String) {
    public function streamSong() {
    time = new Timer(50);
    connection = new NetConnection();
    connection.addEventListener(NetStatusEvent.NET_STA TUS, netStatusHandler);
    connection.addEventListener(SecurityErrorEvent.SEC URITY_ERROR, securityErrorHandler);
    private function netStatusHandler(event:NetStatusEvent):void {
    switch (event.info.code) {
    case "NetConnection.Connect.Success" :
    case "NetStream.Play.StreamNotFound" :
    trace("Stream not found: " + sound_url);
    case "NetStream.Buffer.Flush" :

    private function securityErrorHandler(event:SecurityErrorEvent):voi d {
    trace("securityErrorHandler: " + event);

    private function connectStream():void {
    stream = new NetStream(connection);
    stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
    stream.addEventListener(AsyncErrorEvent.ASYNC_ERRO R, asyncErrorHandler);
    stream.client = new CustomClient();
    //time.addEventListener(TimerEvent.TIMER, timerHandler);
    private function timerHandler(event:TimerEvent):void {
    private function closeTimer() {
    time.removeEventListener(TimerEvent.TIMER, timerHandler);
    private function asyncErrorHandler(err:AsyncErrorEvent) {
    time.removeEventListener(TimerEvent.TIMER, timerHandler);

    class CustomClient {
    public function onMetaData(info:Object):void {
    trace("metadata: duration=" + info.duration + " width=" + info.width + " height=" + info.height + " framerate=" + info.framerate);
    public function onCuePoint(info:Object):void {
    trace("cuepoint: time=" + info.time + " name=" + info.name + " type=" + info.type);

    With this I am able to play the mp3 - but at a very high speed - like in a FF mode.

    Please help,


    p.s. Did not use Sound Class as the MP3 gets downloaded onto the client system. - It that can be stopped - Please let me know.
    Last edited by neatocoder; November 16th, 2007 at 06:40 AM. Reason: adding information

  10. #10
    well originally when i posted this i meant on the server so that you dont have to d/l, convert, and then reupload, but since that time i've realized that saving it as an flv is fine for this purpose through FMS.

  11. #11


    Quote Originally Posted by Milan View Post
    If you are looking for recording an audio and save it as MP3, any audio editing software can do this.
    For clarification, my project is building a website helping visitors to learn English.

    The goal is to allow a user to hear a word, then record his/her own voice repeating that word and finally to allow them to playback the original word and their own recorded voice for comparison.

    So, it's not merely a matter of converting file formats, it's to provide an online voice recorder that's available to any visitor.

  12. #12

    Delete Resulting Files?

    I've been successful at creating a working recorder, works great.

    Now the issue is... we have so many users using the site, the resulting files are accumulating quite quickly.

    Is there any way to delete the resulting files as the user leaves the activity, as opposed to letting them pile up on the Flash server?



  13. #13

    Online Voice Recorder

    Hi Mike,
    I'm also developing a site to teach English Online and would be very interested in how your project is getting on. Especially the sound recording bit.
    Look forward to hearing from you



  14. #14

    Flash Audio Recorder

    Quote Originally Posted by mrwizzer View Post
    I've been successful at creating a working recorder, works great.

    Now the issue is... we have so many users using the site, the resulting files are accumulating quite quickly.

    Is there any way to delete the resulting files as the user leaves the activity, as opposed to letting them pile up on the Flash server?



    That is so awesome that you figured out how to record audio! Very cool. I just started looking into it. Is there any chance you can share some of that wisdom of yours?


    Michael M

  15. #15
    Registered User
    this might come in handy:


    I'm looking to save out the file in mp3 format though. It seems that you can only record in FLV format.


Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Home About kirupa.com Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012