Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to play sound from URL adress by code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to play sound from URL adress by code

    Hello Ninjas

    I would like to provide my customers a special alerts sounds.
    O need to play sounds from a specific URL adress, for example, now I use this code:
    PlaySound(NinjaTrader.Core.Globals.InstallDir + @"sounds\Alert4.wav");
    I need to play like this:
    PlaySound("http://ninjaconnectbrasil.com/wp-content/uploads/2022/07/Activated-shutdown-system-after-closing-position.wav");

    This simple way is not working, and dont show any message, do you have some code idea to help me??

    Thanks

    #2
    Hello MarceloF,

    Thanks for your post.

    A URL address cannot be passed into the PlaySound() method. The PlaySound() method requires a local file to be used.

    You would need to download the sound file and then use the local path of that file when calling the PlaySound() method.

    Note that the underlying framework used to play the sound requires the audio file to be in PCM .wav format.

    See this help guide page for more information and sample code: https://ninjatrader.com/support/help.../playsound.htm

    Let me know if I may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    672 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    379 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    111 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    575 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    582 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X