-
Recording problem in Flash 8
I have installed Flash Communication Server MX in my Local computer. Recording stuff is working in Flash MX version 6, But same actionscript is not working in Flash 8. I m recording my voice thru microphone. flv file is not created. What sud be the problem? help plz. It is urgent.
Thanks
-
Senior Member
You have to be more specific regarding actionscript.
- The right of the People to create Flash movies shall not be infringed. -
-
Recording actionscript for Flash 8
#include "NetDebug.as"
client_nc = new NetConnection();
client_nc.onStatus = function(info) {
trace("Level: " + info.level + newline + "Code: " + info.code);
}
client_nc.connect("rtmp:/voice_message/room02");//local path
rec_so = SharedObject.getRemote("recordings", client_nc.uri, false);
rec_so.connect(client_nc);
function doRecord() {
if (Record_btn.getLabel() == "Record") {
Status_msg.text="Recording...";
// Stop any currently playing stream
if (Play_btn.getLabel() == "Stop"){
doPlay();
}
// Create output stream
out_ns = new NetStream(client_nc);
// Start publishing the audio output as a recorded stream
out_ns.attachAudio(Microphone.get());
// Publish the stream
out_ns.publish(filename.text, "record");
// Change the button label
Record_btn.setLabel("Stop");
} else if (Record_btn.getLabel() == "Stop") {
// Close output stream
out_ns.close();
// Change the button label
Record_btn.setLabel("Record");
Status_msg.text=" ";
}
}
function doPlay ()
{
if (Play_btn.getLabel() == "Play") {
Status_msg.text="Playing...";
Send_btn.setEnabled(false);
Play_btn.setLabel("Stop");
// Create input stream
in_ns = new NetStream(_root.client_nc);
in_ns.play(filename.text);
in_ns.onStatus = function(info)
{
// Handle errors and stream stopping
if ( info.level == "error" || info.code == "NetStream.Play.Stop" ) {
//Status_msg.text="Stopped sending data...";
Status_msg.text="Playing Completed";
Send_btn.setEnabled(true);
while (in_ns.bufferLength > 0 ) {
//Status_msg.text += "Waiting to clear buffer..."
//Status_msg.text += "Playing completed."
}
Play_btn.setLabel("Play");
}
}
} else if (Play_btn.getLabel() == "Stop") {
Status_msg.text="...";
in_ns.onStatus = null;
Send_btn.setEnabled(true);
// Close the stream
in_ns.close();
Play_btn.setLabel("Play");
}
}
-
Senior Member
One possibility may be security. Change the line under //Start publishing....
out_ns.attachAudio(Microphone.get());
to the lines below. What do you get?
// Start publishing the audio output as a recorded stream
var active_mic:Microphone = Microphone.get ();
out_ns.attachAudio (active_mic);
trace (active_mic.muted);
Also I transfer you to a different forum, since I am not expertised in this.
- The right of the People to create Flash movies shall not be infringed. -
-
I made changes you suggested. I m getting 'true'. Now what to do? I m also getting Privacy Setting pop-up to allow to access Microphone. But Voice is not recorded.
Assist plz, thanx
-Chintan Parmar
web developer
"Love life"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|