PlaySound()
<< Click to Display Table of Contents >> PlaySound() |
Plays a .wav file while running on real-time data.
Notes: 1. This method will only execute once the State has reached State.Realtime. Calls to this method during State.Historical will be ignored (in contrast to the implementation for AddOns) 2.The default behavior is to play the .wav file in an asynchronous manner, which can result in calls to PlaySound() to play over one another. Sound files can optionally be configured to execute in a synchronous manner by enabling the Tools > Options > Sounds > "Play consecutively" property |
This method does not return a value.
PlaySound(string fileName)
Warning: The underlying framework used to play the sound requires the audio file to be in PCM .wav format. Using another file format such as will generate an error at runtime. |
fileName |
The absolute file path of the .wav file to play |
Tip: You can obtain the default NinjaTrader installation directory to access the sounds folder by using NinjaTrader.Core.Globals.InstallDir property. Please see the example below for usage. |
// Plays the wav file mySound.wav |