Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaTrader 8 Beta 2 PlaySound And Alert Audio wav File Issues

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

    NinjaTrader 8 Beta 2 PlaySound And Alert Audio wav File Issues

    I am unable to play any wav files in the "sounds" folder with either PlaySound or Alert.

    It appears that NT8 does not know where its "sounds" folder is.

    The help website example below shows that you have to type in an explicit path.

    PlaySound(@"C:\mySound.wav");

    I put a wav file in the "C:\" location and was able to play that file from an indicator but it played nonstop even though the code is to play only on FirstTickOfBar as shown below.

    protected override void OnBarUpdate()
    {
    if(IsFirstTickOfBar && State != State.Historical)PlaySound(@"C:\beep.wav");
    }

    When specifying just the wav file name like in NT7, I keep getting error messages:"Please be sure a sound file exists at the specified location.

    Please provide info on how to play wave files residing in the sounds folder for both PlaySound and Alerts.



    Thanks.
    Last edited by RJay; 07-08-2015, 03:36 PM.
    RJay
    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

    #2
    Hello,

    I seem to be experiencing the same issue on my end. I'm going to dig into this issue further, and I will post on this thread with any information or updates.
    Dave I.NinjaTrader Product Management

    Comment


      #3
      Hello,

      After testing further, it appears that you will need to use the entire file path in the current beta release. I will submit a report to our team to look further into the inability to auto-detect the path.

      When I used your setup on my end, I did not experience the issue with the sound playing continuously on my end. Can you send me a full export of your code, so that I can test it and see if anything else is coming into play?
      Dave I.NinjaTrader Product Management

      Comment


        #4
        Originally posted by NinjaTrader_Dave View Post
        Hello,

        After testing further, it appears that you will need to use the entire file path in the current beta release. I will submit a report to our team to look further into the inability to auto-detect the path.

        When I used your setup on my end, I did not experience the issue with the sound playing continuously on my end. Can you send me a full export of your code, so that I can test it and see if anything else is coming into play?

        Hi Dave,

        Please post the code you used to reach the NinjaTrader sounds folder.

        Thanks,

        RJay
        RJay
        NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

        Comment


          #5
          This is what I used:

          Code:
          protected override void OnBarUpdate()
          		{
          			if(IsFirstTickOfBar&& State != State.Historical)
          			{
          				PlaySound(@"C:\Program Files (x86)\NinjaTrader 8\sounds\Alert1.wav"); 
                                  }
          			
          		}
          Keep in mind that while we are still working on this, you can also use NinjaTrader.Core.Globals.InstallDir to dynamically populate the path to the installation directory.
          Dave I.NinjaTrader Product Management

          Comment


            #6
            NinjaTrader 8 - Beta 7:

            I still need to enter the entire path to the sounds directory to play sounds via Alert().

            Comment


              #7
              I'd like to add my two cents...

              I had this "problem" too and the way I see it, it isn't a problem. It is the way it is supposed to be. In the release notes, I read somewhere that Ninja 8 is seeking to conform to industry standards. Requiring the entire path and file name to the sound file is the way I think you should leave it. I thought that was an intentional change. I had no idea you did that by accident.

              If you make it work both ways - having Ninjatrader assume the Sounds directory in the install dir and also make it accept a path, that would be fine. But forcing the user to code to the Sounds directory in the install dir, is I think wrong. What if my sound files were somewhere else?

              This is what I'm using:
              Code:
              string soundFilePath = string.Format( @"{0}sounds\{1}", NinjaTrader.Core.Globals.InstallDir, SoundFileName );
              PlaySound( soundFilePath );
              Or you could just put pass the whole string.Format() to PlaySound.

              Comment


                #8
                Originally posted by traderpards View Post
                I'd like to add my two cents...

                I had this "problem" too and the way I see it, it isn't a problem. It is the way it is supposed to be. In the release notes, I read somewhere that Ninja 8 is seeking to conform to industry standards. Requiring the entire path and file name to the sound file is the way I think you should leave it. I thought that was an intentional change. I had no idea you did that by accident.

                If you make it work both ways - having Ninjatrader assume the Sounds directory in the install dir and also make it accept a path, that would be fine. But forcing the user to code to the Sounds directory in the install dir, is I think wrong. What if my sound files were somewhere else?

                This is what I'm using:
                Code:
                string soundFilePath = string.Format( @"{0}sounds\{1}", NinjaTrader.Core.Globals.InstallDir, SoundFileName );
                PlaySound( soundFilePath );
                Or you could just put pass the whole string.Format() to PlaySound.
                Appreciate you observations and you are correct: It was an intentional change for the reasons cited... apologize that the thread was not updated earlier with those conclusions. However we did note that this was not in the code breaking changes, so we will be adding that here shortly.
                MatthewNinjaTrader Product Management

                Comment


                  #9
                  Originally posted by NinjaTrader_Matthew View Post
                  Appreciate you observations and you are correct: It was an intentional change for the reasons cited... apologize that the thread was not updated earlier with those conclusions. However we did note that this was not in the code breaking changes, so we will be adding that here shortly.
                  Fair enough, but let us also remember that in NT7, the ...\Sounds folder was just a default that was applied when the unadorned file name was specified. One could always specify the full path if one wanted to.

                  Just a correction. It makes no difference to me: I generally specified the full path anyway, even in NT7.

                  Hence, these threads:http://ninjatrader.com/support/forum...d.php?p=243401


                  as we created a file-picker dialog.
                  Last edited by koganam; 12-09-2015, 10:05 AM.

                  Comment


                    #10
                    Originally posted by koganam View Post
                    we created a file-picker dialog.
                    That's the best approach. That way the user is in control of everything and the programmer doesn't have to assume or know anything.

                    Can you give a WPF novice any clues as to how to accomplish that in the Properties dialog?

                    I've done that in Windows Forms using a class I "borrowed" (somewhere) but I don't have a clue in WPF.

                    Comment


                      #11
                      Originally posted by traderpards View Post
                      That's the best approach. That way the user is in control of everything and the programmer doesn't have to assume or know anything.

                      Can you give a WPF novice any clues as to how to accomplish that in the Properties dialog?

                      I've done that in Windows Forms using a class I "borrowed" (somewhere) but I don't have a clue in WPF.
                      Well, the issue with WPF is that there appears to be no default PropertyGrid, and we must each roll our own. Fortunately, NinjaTrader in NT8, has supplied us with a custom PropertyGrid, and has written an editor for us. They call it the PropertyEditor.

                      ref: http://ninjatrader.com/support/forum...38&postcount=6


                      Curiously enough, the internal mechanics may reflect similar thinking, as, as I state in the thread, specifying a mask of *.wav does default the file-picker to the ...\sounds folder. A *.* filter mask defaults to the ...\documents folder.

                      Comment


                        #12
                        Interesting that you folks with NT 8 had issues with sound files yesterday. I also did with NT 7 except they were all going off at different times when they shouldn't have been. I closed ALL my charts in all workspaces and the alert sounds just kept going off. LOL

                        I finally took those four files out of the sound folder to shut them up.

                        Comment


                          #13
                          Again thank you for your reply. That definitely solved the problem!

                          Originally posted by traderpards View Post
                          I'd like to add my two cents...

                          I had this "problem" too and the way I see it, it isn't a problem. It is the way it is supposed to be. In the release notes, I read somewhere that Ninja 8 is seeking to conform to industry standards. Requiring the entire path and file name to the sound file is the way I think you should leave it. I thought that was an intentional change. I had no idea you did that by accident.

                          If you make it work both ways - having Ninjatrader assume the Sounds directory in the install dir and also make it accept a path, that would be fine. But forcing the user to code to the Sounds directory in the install dir, is I think wrong. What if my sound files were somewhere else?

                          This is what I'm using:
                          Code:
                          string soundFilePath = string.Format( @"{0}sounds\{1}", NinjaTrader.Core.Globals.InstallDir, SoundFileName );
                          PlaySound( soundFilePath );
                          Or you could just put pass the whole string.Format() to PlaySound.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Christopher_R, Today, 12:29 AM
                          0 responses
                          6 views
                          0 likes
                          Last Post Christopher_R  
                          Started by sidlercom80, 10-28-2023, 08:49 AM
                          166 responses
                          2,235 views
                          0 likes
                          Last Post sidlercom80  
                          Started by thread, Yesterday, 11:58 PM
                          0 responses
                          3 views
                          0 likes
                          Last Post thread
                          by thread
                           
                          Started by jclose, Yesterday, 09:37 PM
                          0 responses
                          7 views
                          0 likes
                          Last Post jclose
                          by jclose
                           
                          Started by WeyldFalcon, 08-07-2020, 06:13 AM
                          10 responses
                          1,415 views
                          0 likes
                          Last Post Traderontheroad  
                          Working...
                          X