Skip to main content
Participant
July 26, 2010
Question

Write access denied for stream error when recording audio stream

  • July 26, 2010
  • 1 reply
  • 2123 views

Hi guys,

I've had FMS running on my local machine for a while and have had a little experience writing FMS apps, but I've just tried recording audio for the first time using the standard vod application and I keep getting a "Write access denied for stream" error. My AS3 code is copied and pasted for various examples and am confident that it works.

I'm running Windows XP service pack 3 & FMIS 3.5.

If anyone has any ideas? I've had a look at the vod/media directory and under windows->properties the read-only attribute is ticked. Every time I un-tick this it reverts back to being ticked. I've googled this and MS say that most programs ignore the read-only attribute and that it only really applied to files. I've also tried the MS fix for setting the read-only attribute via cmd and still no joy (doesn't fix read-only attribute or FMS recording the audio after setting via cmd).

I've also tried our dev server install of FMS (running under linux) and am getting the same results.

Here's my AS3 code...

private function initApp(event:Event):void

{

     removeEventListener(Event.ADDED_TO_STAGE,initApp);

     nc = new NetConnection();

     nc.client = this;

     nc.addEventListener(NetStatusEvent.NET_STATUS, handleNetStatus);

     nc.addEventListener(IOErrorEvent.IO_ERROR, handleIOError);

     nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR, handleSecurityError)

     nc.connect("rtmp://localhost/vod");

     //--FORCE SETTING MIC MANAGER

     var mic:Microphone = Microphone.getMicrophone();

     stage.addEventListener(MouseEvent.CLICK ,handleMouseClick);

}

private function handleNetStatus(event:NetStatusEvent):void

{

     switch (event.info.code)

     {

           case "NetConnection.Connect.Success":

                trace("NC connected");

                ns = new NetStream(nc);

               var mic:Microphone = Microphone.getMicrophone();

               trace('mic: ' + (mic));

               ns.attachAudio(mic);

               ns.addEventListener(NetStatusEvent.NET_STATUS, handleNetStreamNetStatus);

           break;

          

           case "NetStream.Publish.BadName":

                trace("Please check the name of the publishing stream" );

                  break;

     }

}

private function initNetStream():void

{

     ns.publish("test", "record");

}

Thanks

Mike

    This topic has been closed for replies.

    1 reply

    July 27, 2010

    Hi Mike

    You are getting the "Write access denied for stream" because you are trying to accomplish a recording in the vod app. The vod's server-side code doesn't allow for that.

    To get around that you can try doing one of the below:

    1)The vod application found at FMS Installer directory\applications\ is a signed app and wouldn't allow you to edit the server-side code.

    You can replace that with the vod application placed at FMS Installer directory\samples\applications\. You will find main.asc here.

    Comment the line ,

              p_client.writeAccess = ""; // prevents creating shared object or live streams.

    Unload the vod app if already connected and try connecting and publishing again. The recording should work.

    2) Instead of using vod application, you can create another application on FMS and publish to it to accomplish recording.

    Regards

    Mamata