Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PlaySound()

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

    PlaySound()

    Please show me where I'm being stupid. I've played sounds before from code and now i can't make it work. The sound I'm trying to play is in the nt sounds folder. I insert this line of code into my indicator without any conditions just to test it and no sound is played nor is there an error in the log.

    PlaySound(@"Alert4"); No sound is played, no error and my computer make other sounds without any problem. So it isn't the computer.

    #2
    Hello Mike,

    Are you receiving any errors on the Log tab of the Control Center when the alert should be triggering?

    Is this the default Alert4.wav, or did you replace it with a custom .wav file?
    MatthewNinjaTrader Product Management

    Comment


      #3
      like i said...no errors in the log and yes they are the sound files that came with nt7

      Comment


        #4
        Hello Mike,

        If you're using PlaySound() with a default sound file, you do not need to specify a path with the @ symbol. This should only be used if you are directing the sound outside of the default directory:

        Please try using PlaySound("Alert4.wav");

        If using CalulateOnBarClose = True, this alert will not trigger until the next bar forms.
        MatthewNinjaTrader Product Management

        Comment


          #5
          cobc is set to false and removed the @ symbol


          What I sent you was PlaySound(@"Alert4");
          Very dumb I changed to this...PlaySound("Alert4.wav"); I forgot to include the file extension.

          Comment


            #6
            Mike,

            Is it working on bar update now?
            MatthewNinjaTrader Product Management

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            598 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            343 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            557 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            555 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X