Solved

Can a Flash app stream back to the server both mp3 audio out and MIC in?

Posted on 2008-06-16
4
230 Views
Last Modified: 2013-11-11
I want to write an application in Flash that will play an mp3 on the client side, take the audio output from the mp3 player along with the Microphone in and stream both back to my server.  Is this possible in Flash?

I could use some help, so any suggestions or comments that put me in the right direction are appreciated.

thanks
0
Comment
Question by:James Glaubiger
  • 2
4 Comments
 
LVL 12

Expert Comment

by:SamuelRostol
Comment Utility
You can probably write a application in AIR that saves temporarily the sound on the computer, and then uploads it to server via php (or something like that), but I'll have to dissapoint you elsewise. Flash cannot store anything on your computer, and I believe that Flash needs an actual file to upload...
0
 
LVL 12

Expert Comment

by:SamuelRostol
Comment Utility
Sorry, typo:
"I believe that PHP needs an actual file to upload"
0
 
LVL 7

Author Comment

by:James Glaubiger
Comment Utility
Any other ideas? Can flash actually do what I want?
0
 
LVL 4

Accepted Solution

by:
emphaticDigital earned 500 total points
Comment Utility
The basic class you need to implement is the Socket class. It can both read and write raw binary data with no restrictions on the data type.

You can use the NetConnection/NetStream objects to handle grabbing the mic input and you should also be able to use them for sending it to the server.

The problem is keeping track of the raw binary info from the MP3 and the mic, which is why you need the Socket class.

Of course, the Flash Security model will determine whether the communication is allowed at all.

I feel like if you use both of those classes, a solution should be available. It would be high level stuff though without the use of a Flash Remoting Server, which is a separate product available from Adobe. If you set up Flash Remoting on your server, I think it will be more straight forward. I have a socket project coming up, but not for another month, so I'm still researching ways to get around the costly Flash Remoting. Adobe has an open source server called Blaze for socket connections also.

Hope this helps.

PS - PHP can handle binary data, so if you can succesfully capture the raw binary from both the loaded MP3 and the mic, you could write a server deamon in PHP to handle recreating the sound file on your server. Java would also work.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now