GotSpeech.NET

The online community for Microsoft Speech Server developers
Welcome to GotSpeech.NET Sign in | Join | Help
in Search
Computer-Talk

How to get record file

Last post 05-12-2008, 5:37 AM by Raj. 13 replies.
Sort Posts: Previous Next
  •  06-04-2007, 3:06 PM 3198

    How to get record file

    Hi all,

     I am trying to record the message, and get the message store in the database. I follow the example lab2 in the jump start training, and i could find the location of the file. However, after we listen to the message, the message is automatically deleted. Are there anyway we can modify the way that recordactivities did to the recording file.

    khanh
     

  •  06-04-2007, 4:41 PM 3203 in reply to 3198

    Re: How to get record file

    I'm not familiar with the jump start training you mentioned so I don't know what lab2 does, however is is by design that the the recording is deleted.

    You can get the location of the file from the "RecordedFilePath" property of the activity. You'll have to do what you want to do to the file before the activity finishes executing because I think that's when it will be deleted.


    --
    How To Ask a Question: http://support.microsoft.com/kb/555375
    --
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Use of included script samples are subject to the terms specified at
    http://www.microsoft.com/info/cpyright.htm
  •  09-13-2007, 10:19 AM 3804 in reply to 3203

    Re: How to get record file

    i want to check out the recorded messages, once a week. is it possible to get the recorded message?

  •  09-13-2007, 11:16 AM 3807 in reply to 3804

    Re: How to get record file

    From the message immediately before yours -

        "You can get the location of the file from the "RecordedFilePath" property of the activity. You'll have to do what you want to do to the file     before the activity finishes executing because I think that's when it will be deleted."


    --
    How To Ask a Question: http://support.microsoft.com/kb/555375
    --
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Use of included script samples are subject to the terms specified at
    http://www.microsoft.com/info/cpyright.htm
  •  09-13-2007, 11:30 AM 3808 in reply to 3807

    Re: How to get record file

    I haven't tried the RecordMessageActivity but I don't thnk it is deleted until later possibly when the application finishes. I base that on this example from the help docs.

    The following example shows the TurnStarting event handler for a StatementActivity named playMessage. The MainPrompt for playMessage plays an audio file previously recorded in a RecordMessageActivity and stored at the location represented by RecordedFilePath.

    C#
    private void playMessage_TurnStarting(object sender, 
    TurnStartingEventArgs e)
    {
      this.playMessage.MainPrompt.ClearContent();
      this.playMessage.MainPrompt.AppendAudio(
      this.recordMessage.RecordedFilePath);
    }

    I'll play around with this to confirm it (if no one else confirms it) when I get back from my road trip.

    The Jump Start material is something that Microsoft has provided to GotSpeech and we are hosting it for our users. You can read more about it here http://gotspeech.net/blogs/marshallharrison/archive/2007/04/27/ocs-speech-server-2007-jumpstart.aspx

     


    Marshall Harrison
    Microsoft MVP, Office Communications Server


    www.GoldSys.com
    W: 303.447.2774
    H: 904.342-6205

    the gotspeech guy
  •  09-13-2007, 11:33 AM 3809 in reply to 3808

    Re: How to get record file - Public Thank You

    Once again I want to publicly thank Ahmed and the rest of the Microsoft people who spend some of their valuable time helping out in our forums.

    Your insight and participation is greatly appreciated by all of our members.


    Marshall Harrison
    Microsoft MVP, Office Communications Server


    www.GoldSys.com
    W: 303.447.2774
    H: 904.342-6205

    the gotspeech guy
  •  09-14-2007, 6:33 AM 3815 in reply to 3809

    Re: How to get record file - Public Thank You

    hi,

    I cant able to get the file and the control moves to next control. So i tried to take the file in the action event.

    Its working fine, but i wan to take all the recorded message once a week.

    I think, we can get the recorded message from etl file.

    Is it right?

  •  09-14-2007, 9:43 AM 3818 in reply to 3815

    Re: How to get record file - Public Thank You

    If you have audio logging enabled, yes you can get the audio that MSS "heard" from the ETL file.

    Why not just copy the recorded files to some location where you can retrieve them when you want?
     


    --
    How To Ask a Question: http://support.microsoft.com/kb/555375
    --
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Use of included script samples are subject to the terms specified at
    http://www.microsoft.com/info/cpyright.htm
  •  10-18-2007, 7:57 AM 4019 in reply to 3818

    Re: How to get record file - Public Thank You

    Can you specify when and where this file is created ?
    And is the recordAudioActivity property "LogResults=True" what you mean with audio loggin enabled ?
     

  •  10-18-2007, 8:31 AM 4021 in reply to 4019

    Re: How to get record file - Public Thank You

    If you have the logging configured to do so the audio will be in the .etl files. If you use MssLogToDatabase you can import the files into a SQL database and get to them there using the Analytics and Tuning Studio.

    Also Stephen Potter did a blog about extracting audio directly from the .etl files - http://blogs.msdn.com/spokenword/archive/2007/08/30/extracting-session-audio-from-ocs-2007-speech-server-logs.aspx

     


    Marshall Harrison
    Microsoft MVP, Office Communications Server


    www.GoldSys.com
    W: 303.447.2774
    H: 904.342-6205

    the gotspeech guy
  •  02-09-2008, 10:12 PM 4677 in reply to 4021

    Re: How to get record file - Public Thank You

    I can't seem to get the recordAudioActivity to work. It would seem fairly easy to use but I don't even here the beep when I set the PlayBeep=true;

     
    I can see the temporary file being created but its only 1KB. Any ideas?


    - Manit
  •  02-09-2008, 11:21 PM 4678 in reply to 4677

    Re: How to get record file - Public Thank You

    I got it work, I had to set the CanBargeIn property to false. and my microphone input volume was set to low.

    - Manit
  •  02-10-2008, 12:29 AM 4679 in reply to 4678

    Re: How to get record file - Public Thank You

    I was able to copy the wave file from the recordAudioActivity. The code snipe below was put in the turning start event of the next action after the recordaudioactivity. I'm sure you could use the same code on one of the event handlers on the recordaudioactivity.
     

    System.IO.File.Copy(recordAudioActivity1.RecordedFilePath, "c:\\temp\\copy.wav");

     


    - Manit
  •  05-12-2008, 5:37 AM 5512 in reply to 3804

    Re: How to get record file

    Yes its possible. What you need to do is , Record the message with the file name concatinating with the date and save it in the prompt location folder.

    For Example :- RecMess_05122008_1 , RecMess_05122008_2,RecMess_05132008_3 .Once the messages are stored in the prompt location, go with the directory stucture and pick all the files and assign to QuestionAnswerActivity or statementactivity,  append audio with bookmark and loop all the files , the questionanswer activity  or statement activity will play all the prompts.

    Before that you need to get only files of start date and end date ,for this get the file and append the file to arrayList with the start and end date of the file name. 

    then bind to Question answer activity or statement activity to prompt to the user. 

    Here is the code to save the recoreded message.


    this.recordMessage.AudioEncoding = Microsoft.SpeechServer.Codec.Pcm
    this.recordMessage.CanBargeIn = true;
    this.recordMessage.EndSilenceTimeout = System.TimeSpan.Parse("00:00:01.5000000");
    this.recordMessage.InitialSilenceTimeout = System.TimeSpan.Parse("00:00:01.5000000");
    this.recordMessage.Name = "recordMessage";
    this.recordMessage.PlayBeep = true;
    this.recordMessage.SilenceTrimmedLength = System.TimeSpan.Parse("00:00:00.5000000");
    this.recordMessage.TerminationDigits = Microsoft.SpeechServer.RecordTerminationDigits.None;
    this.recordMessage.UseDefaultGrammars = true;

    Once the code is added to the record message activity add a code activity , double click on the code activity and add the following code

    as show below.

     if (recordMessage.RecordedFilePath != null)

                {

                    NameValueCollection Settings = ConfigurationManager.AppSettings;
                    string strRecorededPromptsLocation = @"c:\RecodedMessages";
                   
                    string strFileName = "RecMess_" + DateTime.Now + ".wav";
                    string messageStorageLocation = strRecorededPromptsLocation + strFileName;

                    if (null != messageStorageLocation)
                    {
                        File.Copy(recordMessage.RecordedFilePath, messageStorageLocation, true);
                     
                    }
                }

     Then add the logic to get the recoded files and bind to control.

     


    A.K.Raju
    Sr.Software Engineer
    Speech server 2007.
View as RSS news feed in XML