Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Voice recording is not working in server

Voice recording is not working in server

Scheduled Pinned Locked Moved ASP.NET
helpdesignsysadminsecurityworkspace
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lijo Rajan
    wrote on last edited by
    #1

    Hai all , I have used the folliwing code to record voice in my application. using Microsoft.VisualBasic.Devices; using Microsoft.VisualBasic;using System.Runtime.InteropServices; public partial class record : System.Web.UI.Page { [DllImport("winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] private static extern int mciSendString(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback); protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { // record from microphone mciSendString("open new Type waveaudio Alias recsound", "", 0, 0); mciSendString("record recsound", "", 0, 0); } protected void Button2_Click(object sender, EventArgs e) { // stop and save mciSendString("save recsound c:\\lijo.wav", "", 0, 0); mciSendString("close recsound ", "", 0, 0); Computer c = new Computer(); c.Audio.Stop(); } protected void Button3_Click(object sender, EventArgs e) { Computer computer = new Computer(); computer.Audio.Play("c:\\lijo.wav", AudioPlayMode.Background); } } it is perfectly working in my local system.But when i uploaded into sver it is showing the following error. Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: System.Security.Permissions.SecurityPermission Source Error: Line 28: mciSendString("record recsound", "", 0, 0); Line 29: Line 30: } Line 31: protected void Button2_Click(object sender, EventArgs e) Line 32: { plse help me its urgent. Thanks in advance regrds Lijo

    R 1 Reply Last reply
    0
    • L Lijo Rajan

      Hai all , I have used the folliwing code to record voice in my application. using Microsoft.VisualBasic.Devices; using Microsoft.VisualBasic;using System.Runtime.InteropServices; public partial class record : System.Web.UI.Page { [DllImport("winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] private static extern int mciSendString(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback); protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { // record from microphone mciSendString("open new Type waveaudio Alias recsound", "", 0, 0); mciSendString("record recsound", "", 0, 0); } protected void Button2_Click(object sender, EventArgs e) { // stop and save mciSendString("save recsound c:\\lijo.wav", "", 0, 0); mciSendString("close recsound ", "", 0, 0); Computer c = new Computer(); c.Audio.Stop(); } protected void Button3_Click(object sender, EventArgs e) { Computer computer = new Computer(); computer.Audio.Play("c:\\lijo.wav", AudioPlayMode.Background); } } it is perfectly working in my local system.But when i uploaded into sver it is showing the following error. Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: System.Security.Permissions.SecurityPermission Source Error: Line 28: mciSendString("record recsound", "", 0, 0); Line 29: Line 30: } Line 31: protected void Button2_Click(object sender, EventArgs e) Line 32: { plse help me its urgent. Thanks in advance regrds Lijo

      R Offline
      R Offline
      rahul1455
      wrote on last edited by
      #2

      Hi Lijo, The same happened to me also,I did n't get any error on server side but only empty file is storing with out recording.Everything working fine on my local machine. Please suggest me if you have any idea. Thanks

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups