DspPlaySound()

Using the DspPlaySound(...)  function, and it seems to work OK, except for the fact that the cursor turns into an hourglass while the sound plays.  If it catches it correctly, a program open indicator in the windows taskbar opens and closes.  Distracting, at best. It does almost seem to be a blocking function.

I see TN000028223 that references a memory leak in the function based on the XML Parser used in windows, but the Microsft documentation is quite confusing about how to update it.

Has anybody else seen this?  Beter yet,has anybody else fixed it?

Parents
  • Hi  ,

    The Se.Citect.PlaySound.exe was originally created to overcome a memory leak in the Windows OS sndPlaySound(), which has subsequently been fixed. In the latest version of Plant SCADA 2020 R2 (formerly Citect SCADA) they have removed this middleware, and reverted to use actual OS API. But there is a need to introduce a mode, to differentiate between sound file and system sound. Here is update to help:

    ----------------------------
    Plays a waveform (sound). Wave form sound files *.WAV are provided with Windows
    and by third-party developers, or you can record them yourself to play long
    (and complex) sound sequences.
    
    When the “sSoundname” is a sound file path and “nMode” is “0”, this function
    loads the .wav file from the specified path (Sound Files) and plays the
    associated waveform. If the specified sound file is not available in the
    mentioned path, a fail error will be returned and a hardware alarm will be
    reported. Use of a system sound in this mode is not supported and will result
    in return of a fail error and report of a hardware alarm.
    
    When the “sSoundname” is a system sound name and “nMode” is “1”, this function
    searches the system for the entry with the specified name, and plays the
    associated waveform. If the name cannot be found, there is no error indicated
    in either the return value or hardware alarm. For this reason, the use of mode
    0 with waveform files is recommended over mode 1 with system sounds. Further,
    use of a valid wave form sound file in this mode instead of mode "0" will
    result in return of a fail error and report of a hardware alarm informing the
    wrong mode is in use.
    
    ------------------------------
    

    I will ask the GCS team to write a TN to cover this information. It looks like your work around is valid.

    Can you also confirm which version / update you are currently using?

    Kind regards

    Olivier

Reply Children