Error when saving voice using mciSendString

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • BigC

    #1

    Error when saving voice using mciSendString

    I am using the following line of code to save a voice file (.wav) to
    disk and it works fine when the filename contains no spaces. However
    the file doesn't get saved when its name contains a space. Does anyone
    know what is going wrong and how I can fix it ?


    nReturn = mciSendString(" save Voice1 " & m_sVoiceFile, "0", 0, 0)

  • Herfried K. Wagner [MVP]

    #2
    Re: Error when saving voice using mciSendString

    "BigC" <christopher.sm ith2@baesystems .comschrieb:
    >I am using the following line of code to save a voice file (.wav) to
    disk and it works fine when the filename contains no spaces. However
    the file doesn't get saved when its name contains a space. Does anyone
    know what is going wrong and how I can fix it ?
    >
    nReturn = mciSendString(" save Voice1 " & m_sVoiceFile, "0", 0, 0)
    Untested: Surround the path with double quotation characters
    ('ControlChars. Quote' or two consecutive double quotes inside a string
    literal) or convert it to the old 8.3 path format (this is IMO only possible
    using p/invoke calls too).

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

    Comment

    • BigC

      #3
      Re: Error when saving voice using mciSendString

      On 4 Jun, 21:03, "Herfried K. Wagner [MVP]" <hirf-spam-me-h...@gmx.at>
      wrote:
      "BigC" <christopher.sm i...@baesystems .comschrieb:
      >
      I am using the following line of code to save a voice file (.wav) to
      disk and it works fine when the filename contains no spaces. However
      the file doesn't get saved when its name contains a space. Does anyone
      know what is going wrong and how I can fix it ?
      >
      nReturn = mciSendString(" save Voice1 " & m_sVoiceFile, "0", 0, 0)
      >
      Untested: Surround the path with double quotation characters
      ('ControlChars. Quote' or two consecutive double quotes inside a string
      literal) or convert it to the old 8.3 path format (this is IMO only possible
      using p/invoke calls too).
      >
      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
      The ControlChars.Qu ote work a treat, thanks :-)

      Comment

      Working...