The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


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...

    http://www.kirupa.com/forum/showthread.php?t=17331

    Mike

  3. #3
    Mike,
    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
    Mike,
    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?

    Thanks!

    Mike

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

    http://evolve.reintroducing.com/2007...-media-server/

  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!).

    Thanks,

    Mike

  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:

    http://evolve.reintroducing.com/2007...ion-for-newbs/

    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!
    Mike

  9. #9
    Hi,

    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) {
    sound_url=url;
    streamSong();
    }
    public function streamSong() {
    time = new Timer(50);
    connection = new NetConnection();
    connection.objectEncoding=ObjectEncoding.AMF0;
    connection.addEventListener(NetStatusEvent.NET_STA TUS, netStatusHandler);
    connection.addEventListener(SecurityErrorEvent.SEC URITY_ERROR, securityErrorHandler);
    connection.connect("rtmp://127.0.0.1:1935/Testing/audio/");
    }
    private function netStatusHandler(event:NetStatusEvent):void {
    trace(event.info.code);
    switch (event.info.code) {
    case "NetConnection.Connect.Success" :
    connectStream();
    break;
    case "NetStream.Play.StreamNotFound" :
    trace("Stream not found: " + sound_url);
    closeTimer();
    break;
    case "NetStream.Buffer.Flush" :
    closeTimer();
    break;
    }
    }

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

    private function connectStream():void {
    stream = new NetStream(connection);
    stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
    stream.addEventListener(AsyncErrorEvent.ASYNC_ERRO R, asyncErrorHandler);
    stream.receiveAudio(false);
    stream.client = new CustomClient();
    //stream.bufferTime=20;
    stream.play("mp3:"+sound_url);
    //time.addEventListener(TimerEvent.TIMER, timerHandler);
    //time.start();
    }
    private function timerHandler(event:TimerEvent):void {
    trace(stream.time);
    }
    private function closeTimer() {
    trace("Closed");
    time.removeEventListener(TimerEvent.TIMER, timerHandler);
    time.stop();
    stream.close();
    }
    private function asyncErrorHandler(err:AsyncErrorEvent) {
    trace(err);
    trace("Closed");
    time.removeEventListener(TimerEvent.TIMER, timerHandler);
    time.stop();
    stream.close();

    }
    }
    }
    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,

    Neatocoder.

    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

    Clarification

    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?

    Thanks,

    Mike

  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

    Thanks

    Paul

  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?

    Thanks,

    Mike
    Mike,

    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?

    Sincerely,

    Michael M

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

    http://www.hiteshagrawal.com/flash/f...h-media-server

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

    Ryan

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

 Credits

Copyright 1999 - 2012