Hello all,
Am stuck with a problem that by all accounts is insurmountable.
But is anything impossible in flash??..(except maybe getting back to macromedia?)..ahem...anyway..
I'm making an application that has to record voice.
After a lot of searching found the attached fla that almost does it. The place i got it from said i have to change attachVideo to attachAudio. But it does'nt work.
I cannot use communication server as this appl. is meant for standalone distribution...
So anyone anywhere??..HELP!
The code on frame 1 is:
//#include "NetDebug.as"
// Attach the video device output from 'client_cam'
// to the 'Live_video' video clip
client_cam=Microphone.get();
//Live_video.attachVideo(client_cam);
Live_video.attachAudio(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("rtmp:/doc_record/room_01");
// Create output stream
out_ns = new NetStream(client_nc);
// Create input stream
in_ns = new NetStream(client_nc);
Replay_video.attachAudio(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.attachAudio(Microphone.get());
out_ns.publish("my_recorded_stream", "record");
// Don’t allow the user to play when recording
Play_btn.setEnabled(false);
// 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("my_recorded_stream");
}