-
Aug 15th, 2022, 06:44 AM
#1
Thread Starter
PowerPoster
[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.
-
Aug 15th, 2022, 07:55 AM
#2
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.
-
Aug 15th, 2022, 07:59 AM
#3
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.
-
Aug 15th, 2022, 10:26 AM
#4
Thread Starter
PowerPoster
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.
-
Aug 15th, 2022, 08:18 PM
#5
Re: [RESOLVED] Audio device failure.
@Poppa Minton - What’s a ‘Debug file’ ???
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Aug 16th, 2022, 05:07 AM
#6
Thread Starter
PowerPoster
Re: [RESOLVED] Audio device failure.
Originally Posted by .paul.
@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.
-
Aug 16th, 2022, 05:39 AM
#7
Re: [RESOLVED] Audio device failure.
Originally Posted by Poppa Mintin
What else would you call: -
"D:\Visual Studio Projects\Projects\AlarmClock\bin\Debug"
Sounds like a Debug folder, rather than a Debug file.
-
Aug 16th, 2022, 06:47 PM
#8
Thread Starter
PowerPoster
Re: [RESOLVED] Audio device failure.
Along with the sunshine there has to be a little rain sometime.
-
Aug 16th, 2022, 07:03 PM
#9
Re: [RESOLVED] Audio device failure.
Originally Posted by Poppa Mintin
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…
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Aug 16th, 2022, 07:50 PM
#10
Re: [RESOLVED] Audio device failure.
Originally Posted by .paul.
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|