recording "failing" the first time...
Hi everyone, I've ran into a weird error and would love some help.
currently, we're running FML 2 and I'm writing a very simple recording application that generates a random stream name and publishes a flv using the microphone on the user's computer. The error I'm running into is that the first time I press record (and run netstream.publish(fileName, "record")) it always fails. if I stop recording, then rerecord it works fine.
an example of the code I'm using:
active_mic = Microphone.get();
active_mic.setGain(90);
today = new Date();
fileName = "test"+today.getTime().toString();
client_nc = new NetConnection();
client_nc.connect("pathToServer");
function startRecording() {
out_ns = new NetStream(client_nc);
out_ns.onStatus = function(info) {trace("Level: " + info.level + "\n Code: " + info.code); }
out_ns.attachAudio(active_mic);
out_ns.publish(fileName, "record");
}
function endRecording() {
out_ns.close();
out_ns.attachAudio(null);
}
like I said, it always fails when I first "record". if I end the recording and start again it works fine.
(the trace basically reads NetStream.Record.NoAccess)
any idea? a workaround I did was to put a publish and close immediately in the begininng to "trick" it to recording. If this is expected then maybe its a bug?
