Results 1 to 10 of 10

Thread: [RESOLVED] Audio device failure.

  1. #1

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Bottesford, North Lincolnshire, England.
    Posts
    2,429

    Resolved [RESOLVED] Audio device failure.

    Hi,

    Today I came to use an application which I've not used for a long time, it failed.
    I've opened the project and found the following 'Not declared' items.
    EDataFlow
    ERole
    MMDevice
    MMDeviceEnumerator
    Code:
     Dim DevEnum As New MMDeviceEnumerator()
     Dim device As MMDevice = DevEnum.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eMultimedia)
    I originally wrote this app. in October 2018 and I've completely forgotten how all this stuff works, but since it all worked perfectly well and I've not touched any of the coding since then, I don't understand why it should stop working now.

    Those items are certainly not actually declared anywhere other than as shown, except the same coding is used in two different subroutines, GetVolume() and SetVolume().

    I'm wondering if a relevant DLL might've been deleted or moved elsewhere, but I can't discover which DLL that might be.


    Poppa
    Along with the sunshine there has to be a little rain sometime.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,347

    Re: Audio device failure.

    The IMMDeviceEnumerator interface id part of the Win32 Core Audio APIs. NAudio is a series of .NET libraries, available as NuGet packages, that wraps those APIs. The MMDeviceEnumerator class is available in the NAudio.Wasapi package. Those other types are likely in the same package or one of the other NAudio packages.

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,347

    Re: Audio device failure.

    Actually, it's probably not NAudio that you want. There's another package named CoreAudio that also wraps those same APIs and it also includes EDataFlow and ERole enumerations, so I'm guessing that's what you need.

  4. #4

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Bottesford, North Lincolnshire, England.
    Posts
    2,429

    Re: Audio device failure.

    Thanks John,

    I remember CoreAudio ought to've been in there somewhere but couldn't find it anywhere in the files, I did find it in an earlier version of the same application (VS2013) in the Debug file. (I didn't know I had the earlier version until I searched for the DLL).

    I tried copying it directly into the later version's Debug file (VS2017) but found that now it didn't like the 'Imports CoreAudio'.
    So I added it properly to the Recourses... Which seems to've done the trick.

    I don't really understand how it could've gone missing, assuming that it was there in the first place.


    Anyway... app.'s back up and running for if I should need it again. Thanks.


    Poppa
    Along with the sunshine there has to be a little rain sometime.

  5. #5
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,481

    Re: [RESOLVED] Audio device failure.

    @Poppa Minton - What’s a ‘Debug file’ ???

  6. #6

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Bottesford, North Lincolnshire, England.
    Posts
    2,429

    Re: [RESOLVED] Audio device failure.

    Quote Originally Posted by .paul. View Post
    @Poppa Minton - What’s a ‘Debug file’ ???
    Hi Paul,

    What else would you call: -
    "D:\Visual Studio Projects\Projects\AlarmClock\bin\Debug"

    Poppa


    PS. I don't pop a mint ON, I pop it IN.

    Pop
    Along with the sunshine there has to be a little rain sometime.

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,347

    Re: [RESOLVED] Audio device failure.

    Quote Originally Posted by Poppa Mintin View Post
    What else would you call: -
    "D:\Visual Studio Projects\Projects\AlarmClock\bin\Debug"
    Sounds like a Debug folder, rather than a Debug file.

  8. #8

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Bottesford, North Lincolnshire, England.
    Posts
    2,429

    Re: [RESOLVED] Audio device failure.

    yeah, I guess it does.
    Along with the sunshine there has to be a little rain sometime.

  9. #9
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,481

    Re: [RESOLVED] Audio device failure.

    Quote Originally Posted by Poppa Mintin View Post
    yeah, I guess it does.
    It is a Folder or a Directory. You’ve been programming long enough to know what a File is and what a Folder is…

  10. #10
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,347

    Re: [RESOLVED] Audio device failure.

    Quote Originally Posted by .paul. View Post
    It is a Folder or a Directory. You’ve been programming long enough to know what a File is and what a Folder is…
    And, to hear Poppa tell it, he's been alive long enough to forget.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width