Tuesday, May 22, 2007

Recording Audio with Flash Player to MP3, WAV, AVI, etc.

My team is currently developing a series of interactive speech recognition application. One of the applications requires us to create a web front end that allows us to record audio from a user microphone and return it to the server. To be able to process the file it must be in WAV format. (Microsoft provides a plug-in that can transfer the audio from a web browser to our server, but it is 60MB and thus would render our application useless.)

We decided to use Flash and quickly found that we could not extract the audio from our recorded FLV files. We had no trouble extracting audio from FLV files that we had generated through our own conversion but we simply could not get the audio out of the files that were being streamed to our Flash Media Server. We discovered that all files converted from another format to FLV store audio in an embedded MP3. Unfortunately, all FLV files recorded from the user’s microphone in by the Flash Player use the Nellymoser audio format. Nellymoser is a highly proprietary mono audio format designed solely for streaming speech. When we looked for a program to decompress this converter we found that Nellymoser offered a converter for $7,500.

We did some more digging and found people claiming that that there was one other converter that would do our decoding, the Total Video Converter. We also found that for only $50.00 we could get our hands on the registered version which includes a command line interface that we could use on our web server. As there was no documentation on how to use the command line features of Total Video Converter I created to following tutorial.

How to Extract Audio from FLV Files Recorded by the Flash Player

Download and install Total Video Converter http://www.effectmatrix.com/total-video-converter/

Use GUI to convert an FLV file.
To convert an FLV that contains video or video and audio, but not audio only, you may use the GUI which is self explanatory. Audio only clips can not be converted with the GUI at this time. (The application simply locks up when we try to convert Nellymoser audio only FLV files).

How to Use the Command Line to Convert a Video (or Audio only FLV) File to another Format
First, obtain the pro version of the software (this is just a registered version).
Now open your command prompt and cd to the directory of the total video converter.
Then enter the command:

“tvc /f inPath.flv /o outPath.wav /pi ini\wav.ini /pn Wav Audio normal quality

Note : You can convert the flv to many different audio or video formats.


In the above example, /f goes before the file to be converted and /o goes before the output file. Following parameters are the /pi and /pn parameters. Warning: If you leave out either the pi or pn parameter you will get the following error: “Error! The option /pi must be set”

The pi parameter is the path to the ini preference file you want to use. In the Total Video Converter application folder there is a subdirectory called ini in that directory is an .ini file for each format supported. In the example above, we want to use the wav.ini file so we use the parameter /pi ini\wav.ini

To set the pn parameter we must go into the ini folder and open the wav.ini file with our text editor. At the top of the wav.ini text document we see “[Wav Audio normal quality].” Farther down we see the line “[Wav Audio high quality].” The text in between the “[ ]” is used as for pn parameter. In the above example we choose “Wav Audio normal quality” and hence used: /pn Wav Audio normal.

Finally, you can write a PHP, ASP.NET, etc server script to launch this command line application to perform the conversion upon user request from your server.

56 comments:

  1. thank you for posting this, we're looking everywhere and will give it a go now. best, ciao
    ReplyDelete
  2. If you're not running a Windows server, you can use the nellynomore tool for Linux.
    ReplyDelete
  3. is it possible to convert flash audio on the fly... like as and when the voice is being streamed to server we convert it instantly..?
    ReplyDelete
  4. No, you can do it on a server after the flv file has been recorded.
    ReplyDelete
  5. Great Tutorial!
    When I run TVC via commandline, it doesn't close after conversion. It just says "OK!" and requires another keystroke to close. That's very annoying for running it from a script (which needs to know when the conversion is finished). Do you have a solution for that?
    Best, Patrick
    ReplyDelete
  6. same problem as patrick.
    Any idea to force it to close without CTRL + C ??

    Yhanks a lot andrew paul simmons for your help
    ReplyDelete
  7. Thanks again for posting this tutorial!

    I seem to be having issues when trying to extract the audio from a FMS recorded .FLV. As you said, the GUI version just crashes when you have an audio-only .FLV but even when I try to perform the conversion using the command line all I get is a non-stop sys-out of "extract flv audio...0%". This has gone on for hours.

    Has anyone else encountered this issue at all?

    Thanks,
    matt
    ReplyDelete
  8. Matt,
    I got the same problem.
    I think it is because we are using "standard version" but not "pro version".

    Dear Sirs, and idea on how to get a "pro version"?

    Thanks,
    sam
    ReplyDelete
  9. https://www.regsoft.net/regsoft/vieworderpage.php3?productid=74266&pc=548CA
    ReplyDelete
  10. Andrew, do you have to convert the stream to a file format in order to send it to a server-side application to process for speech recognition? Doesn't it cause a lag due to: record>convert/extract>process>send back to client? I'm doing some research on if/how flash can be utilized for speech recognition, and I would appreciate if you could share what you have experienced so far, in terms of performance, feasibility, etc.
    Thanks,
    -onur
    ReplyDelete
  11. hello,
    can you give any hint how do you go about doing speech recognition.. is sphinx2/4 good enough for this..?

    thanks
    ash
    ReplyDelete
  12. You also might want to have a look at this: http://www.flashcomguru.com/forum/forum_posts.asp?TID=1842&PN=1&TPN=14
    I tried and it worked flawlessly.
    ReplyDelete
  13. <a href="http://paydayadvisors.org">PaydayLoans</a>Oct 30, 2007 09:34 AM
    7c9vAj You have a talant! Write more!
    ReplyDelete
  14. <a href="http://tes.uab.es/MISS/portal_memberdata/portraits/twkgxziok">Auto insurance company</a>Oct 30, 2007 07:31 PM
    v1WHFJ Hello all!
    ReplyDelete
  15. <a href="http://hydrocodone.99k.org/index.php">Hydrocodone</a>Nov 1, 2007 09:26 PM
    AvkArv The best blog you have!
    ReplyDelete
  16. <a href="http://users2.titanichost.com/buyviagra/211.html">pennsylvania insurance misrepresentation co</a>Nov 2, 2007 10:44 AM
    bKOBTk Thanks to author.
    ReplyDelete
  17. <a href="http://free.7host07.com/nmcfgy/374.html">altered realities tour</a>Nov 2, 2007 11:34 AM
    actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.
    ReplyDelete
  18. <a href="http://fioricet.clanteam.com/?pharma=606">zantax anxiety what is fioricet</a>Nov 2, 2007 12:17 PM
    Please write anything else!
    ReplyDelete
  19. <a href="http://celebrex.zxq.net/?pharma=1194">celebrex side affects</a>Nov 2, 2007 01:23 PM
    Please write anything else!
    ReplyDelete
  20. <a href="http://m1.aol.com/BrettHead14/30.html">online site to view student loans currently owed</a>Nov 2, 2007 02:26 PM
    actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.
    ReplyDelete
  21. <a href="http://users2.titanichost.com/buyviagra/index21.html">phentermine no prescription free consul</a>Nov 3, 2007 03:56 AM
    Hello all!
    ReplyDelete
  22. <a href="http://xenical.newsit.es/month-take-xenical-xenical-year.html">month take xenical xenical y</a>Nov 3, 2007 08:34 AM
    Thanks to author.
    ReplyDelete
  23. <a href="http://xanax.newsit.es/help-with-xanax-withdrawal.html">help with xanax withdrawal</a>Nov 3, 2007 09:36 AM
    actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.
    ReplyDelete
  24. <a href="http://tramadol.newsit.es/stop-the-tramadol.html">stop the tramadol</a>Nov 3, 2007 10:33 AM
    Good job!
    ReplyDelete
  25. <a href="http://phentermine.whdot.com/index.html">viagra</a>Nov 3, 2007 11:20 AM
    Magnific!
    ReplyDelete
  26. <a href="users2.titanichost.com/amalopra">JohnBraun</a>Nov 4, 2007 01:55 AM
    tP0ByQ write more, thanks.
    ReplyDelete
  27. <a href="http://users2.titanichost.com/popebatret/index28.html">college sex porn</a>Nov 4, 2007 07:41 PM
    Nice Article.
    ReplyDelete
  28. <a href="http://users2.titanichost.com/inoryum/index2.html">donkey sex girl</a>Nov 4, 2007 08:17 PM
    actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.
    ReplyDelete
  29. <a href="http://users2.titanichost.com/hviler/index1.html">animal sex vmovies</a>Nov 4, 2007 10:08 PM
    Nice Article.
    ReplyDelete
  30. <a href="http://users2.titanichost.com/ansfur/index12.html">lesbeon sex boobs</a>Nov 4, 2007 10:40 PM
    Magnific!
    ReplyDelete
  31. <a href="http://users2.titanichost.com/olds77/index10.html">elephant anal flap</a>Nov 4, 2007 11:18 PM
    Good job!
    ReplyDelete
  32. <a href="http://users2.titanichost.com/shingro/index15.html">sex after chlamydia</a>Nov 4, 2007 11:46 PM
    actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.
    ReplyDelete
  33. <a href="http://users2.titanichost.com/scersi/index30.html">ebony sex partys</a>Nov 5, 2007 12:16 AM
    Nice Article.
    ReplyDelete
  34. <a href="http://users2.titanichost.com/t1fielde/index19.html">pam lee sex</a>Nov 5, 2007 12:47 AM
    Magnific!
    ReplyDelete
  35. <a href="http://users2.titanichost.com/adjutes/index13.html">bear sex art</a>Nov 5, 2007 01:20 AM
    Magnific!
    ReplyDelete
  36. <a href="http://users2.titanichost.com/adjutes/index13.html">bear sex art</a>Nov 5, 2007 02:01 AM
    Hello all!
    ReplyDelete
  37. <a href="http://users2.titanichost.com/shiconta/index13.html">crazy men sex</a>Nov 5, 2007 02:42 AM
    Hello all!
    ReplyDelete
  38. <a href="http://users2.titanichost.com/gnites3/index2.html">hot reallity sex</a>Nov 5, 2007 03:16 AM
    Wonderful blog.
    ReplyDelete
  39. <a href="http://users2.titanichost.com/marymeno/index14.html">pretty plumpers sex</a>Nov 5, 2007 03:46 AM
    Nice Article.
    ReplyDelete
  40. <a href="http://users2.titanichost.com/vadhoms/index13.html">malaysian sex forum</a>Nov 5, 2007 04:20 AM
    The gene pool could use a little chlorine.
    ReplyDelete
  41. <a href="http://users2.titanichost.com/etooking/index7.html">nice girl sex</a>Nov 5, 2007 04:58 AM
    Good job!
    ReplyDelete
  42. <a href="http://users2.titanichost.com/swiseny/index9.html">discreet sex personals</a>Nov 5, 2007 05:32 AM
    Wonderful blog.
    ReplyDelete
  43. <a href="http://users2.titanichost.com/Lostsoldier3/index23.html">free homemade porn videos</a>Nov 5, 2007 05:59 AM
    What is a free gift ? Aren't all gifts free?
    ReplyDelete
  44. <a href="http://users2.titanichost.com/pyzoid/index34.html">books audio sex</a>Nov 5, 2007 06:28 AM
    What is a free gift ? Aren't all gifts free?
    ReplyDelete
  45. <a href="http://users2.titanichost.com/pyzoid/index34.html">books audio sex</a>Nov 5, 2007 07:03 AM
    Build a watch in 179 easy steps - by C. Forsberg.
    ReplyDelete
  46. <a href="http://users2.titanichost.com/selli83/index22.html">adult sex contact</a>Nov 5, 2007 07:36 AM
    Thanks to author.
    ReplyDelete
  47. <a href="http://users2.titanichost.com/numdaso/index19.html">japanese sex music</a>Nov 5, 2007 08:09 AM
    A flashlight is a case for holding dead batteries.
    ReplyDelete
  48. <a href="http://users2.TitanicHost.com/beveris/hydrocodone-withdrawl-duration.html">hydrocodone with</a>Nov 5, 2007 08:40 AM
    Calvin, we will not have an anatomically correct snowman!
    ReplyDelete
  49. <a href="http://cialis.whdot.com/index20.html">cialis class action suit</a>Nov 5, 2007 09:12 AM
    Ever notice how fast Windows runs? Neither did I.
    ReplyDelete
  50. <a href="http://web.archive.org/web/20070818072041/xanga.com/buyvalium">buyvalium</a>Nov 5, 2007 09:44 AM
    The gene pool could use a little chlorine.
    ReplyDelete
  51. <a href="http://users2.titanichost.com/numdaso/index31.html">japanese sex machine</a>Nov 5, 2007 10:24 AM
    Hello all!
    ReplyDelete
  52. Thank you for this useful Post...
    ReplyDelete
  53. Thanks for this good post....
    ReplyDelete
  54. Hi,

    Two years passed. Do you have any idea about how to convert the flash audio to PCM (WAV) on the fly? using AS3+Red5?

    Regards,
    ReplyDelete
  55. Strange to base a company critical app on some thing that hacked the nellymoser audio format.

    Never flash lets you record in mp, wouldnt that solve the issue or why does it need to be mp3 ?
    ReplyDelete
  56. Hello people want to express my satisfaction with this blog very creative and I really like the views of the focus very good indeed Thank you for the helpful information. I hope you keep up the good work on making your blog a success!
    ReplyDelete