none
Audio issues RRS feed

  • Question

  • Hi

    Strange one this.

    I have an old app that has been in use here for years, with no problems.

    Yesterday, I received a new computer - Surface Pro (old was also a Surface Pro 3)

    The application now shows a weird effect. During use, a user clicks on a Label (one of several), and this invokes a 'click' sound. The user can click on these labels as quickly as needed and, previously, this all worked as expected and the 'click' sounds performed well.

    Now, with the new computer, there are intermittent issues where the user clicks several times on one or other Label and the code in the click event works fine, EXCEPT for the 'click' sound - the 'click' sound stalls for a brief time. Although the code in the click event handler has and does all execute, there is no 'click' sound until a few more label clicks have been done by the user.

    Here is the current code in the label click event handler.

    Private Sub TopLabel_MouseClick(sender As Object, e As MouseEventArgs) Handles Label1.MouseClick, Label2.MouseClick, Label3.MouseClick, Label4.MouseClick, Label5.MouseClick, Label6.MouseClick, Label7.MouseClick
        If Not e.Button = MouseButtons.Left Or GameTime < 1 Then Exit Sub
        Dim lab As Label = DirectCast(sender, Label)
        If Not lab.Text = Nothing Then
            TopClick.Play()
            MoveDown(lab) ' gets here OK and this call works
        End If
        Button3.Visible = True
    End Sub ' gets here with  sometimes no sound issued

    The above code previously used Audio.Play and I have altered to use SoundPlayer to try to fix this glitch. All the audio sounds are .wav file,and preloaded to a SoundPlayer.

    Just for completeness, this is the code for the call to 'MoveDown'

    ' this sub works as expected

    Private Sub MoveDown(lab As Label) Dim s As String = lab.Text If s = Nothing Then Exit Sub lab.Text = Nothing If Label8.Text = Nothing Then Label8.Text = s Exit Sub End If If Label9.Text = Nothing Then Label9.Text = s Exit Sub End If If Label10.Text = Nothing Then Label10.Text = s Exit Sub End If If Label11.Text = Nothing Then Label11.Text = s Exit Sub End If If Label12.Text = Nothing Then Label12.Text = s Exit Sub End If If Label13.Text = Nothing Then Label13.Text = s Exit Sub End If If Label14.Text = Nothing Then Label14.Text = s Exit Sub End If End Sub


    '

    The only thing I can think of now is that there is something wrong with either the .NET (version 4.7.02046), or the fault is with Windows 10.

    '

    Anyone else finding a 'stall' in the use of sounds?


    Regards Les, Livingston, Scotland


    • Edited by leshay Thursday, June 22, 2017 3:21 PM
    Thursday, June 22, 2017 3:11 PM

All replies

  • Hi leshay,

    Thank you for posting here.

    >>The only thing I can think of now is that there is something wrong with either the .NET (version 4.7.02046), or the fault is with Windows 10.

    You could debug one by one. You could check whether the .net framework version of your app is the same as your machine's. If the .Net framework version leaded to the exception, you could check the difference of cource code between .Net Framework version. http://referencesource.microsoft.com/

    Or you could run the program on another computer to check whether the windows cause the error.

    If you could provide some exception messages about your problem, we will provide more suggestions.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, June 29, 2017 3:52 PM
  • Les,

    I did not see your message and the one which Wendy gives will probably only make you angry. (She does not know you are a regular and is from the C# forums and normally I see better ones from here). 

    However, I would not search in your program. I'm partially deaf. You don't want to know how many sound cards I've used to hear at last something. Many simply skip tones or are pinched. 

    I try it mostly to the end with the hardware, I searched the technet forums but it seems there is no professional help on surface.

    But this Microsoft forum exist

    http://www.surfaceforums.net/forums/


    Success
    Cor



    Thursday, June 29, 2017 4:13 PM
  • Hi Wendy

    Thanks for your reply.

    I have compiled this Project on the new computer with whatever a fresh Windows 10 has (.NET version 4.7.02046), my original computer was kept fully up to date so whatever the latest .NET version was available there, then that worked OK with this application.

    Here,I am only talking of a period of time of about 2 days between working normally on old computer and showing issues on new computer.

    This application has run without issue on my previous computer (Surface Pro 3), and it is only on this new computer(Surface Pro 2017) has this issue is become apparent.

    As you mention, I am thinking that perhaps Windows 10 is at fault - even though I haven't noticed anything wrong with sound in any other applications etc.

    I have trawled through various Surface Pro / Windows 10 forums and haven't found any other similar reports (so far)

    Regarding exceptions: there are none. The code posted runs OK, and executes the call to SoundPlayer (and previously Audio.Play) OK - mostly, the sound is played, but several consecutive sounds  will be 'missed'  even though the call to SoundPlayer is executing without any exception.

    Not sure how the link you posted could help.


    Regards Les, Livingston, Scotland


    • Edited by leshay Thursday, June 29, 2017 4:37 PM
    Thursday, June 29, 2017 4:32 PM
  • You might want to Google "audio latency in Windows 10". There are many people who have experienced this problem and I've seen many different suggestions on how to address the issue. You many want to start with the sound chip driver and settings first.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Friday, June 30, 2017 12:32 PM
  • You might want to Google "audio latency in Windows 10". There are many people who have experienced this problem and I've seen many different suggestions on how to address the issue. You many want to start with the sound chip driver and settings first.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Hi Paul

    Thanks.

    I checked out many of the links I found using that google search. Trying a number of suggestions there have unfortunately not improved matters. I did notice that there are quite a few references that the particular computer I own is not a 'desktop' computer and so doesn't perform as such (mostly meaning it isn't capably of many of the optimizations available to full 'desktop' machines)

    It looks like I will have to live with it.

    I may put it on OneDrive and ask for folks to try it out with a view to finding out if it performs without gliches elsewhere.


    Regards Les, Livingston, Scotland

    Friday, June 30, 2017 2:48 PM