coreaudio.dll ile Volume Mixer'dan Spotify sesini kapatmaya çalışıyorum.Erişim İhlali hata kodu çöküyor programı (0xc0000005)
private float volume = 0.9f;
MMDeviceEnumerator DevEnum = new MMDeviceEnumerator();
MMDevice device = DevEnum.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eMultimedia);
AudioSessionManager2 asm = device.AudioSessionManager2;
SessionCollection sessions = asm.Sessions;
try
{
for (int sid = 0; sid < sessions.Count; sid++)
{
string id = sessions[sid].GetSessionIdentifier;
Console.WriteLine(id);
if (id.ToLower().IndexOf("spotify.exe") > -1)
{
if (muted)
{
volume = sessions[sid].SimpleAudioVolume.MasterVolume;
sessions[sid].SimpleAudioVolume.MasterVolume = 0;
}
else
{
sessions[sid].SimpleAudioVolume.MasterVolume = volume;
}
//sessions[sid].SimpleAudioVolume.Mute = muted;
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Bu çıkış ise: Bu benim kodudur
'VMTit.vshost.exe' (CLR v4.0.30319: VMTit.vshost.exe): Loaded 'C:\Users\Maria\Desktop\Spotify-Ad-Blocker-1.6.3.0\VMTit\VMTit2\bin\Debug\VMTit.exe'. Symbols loaded.
'VMTit.vshost.exe' (CLR v4.0.30319: VMTit.vshost.exe): Loaded 'C:\Users\Maria\Desktop\Spotify-Ad-Blocker-1.6.3.0\VMTit\VMTit2\bin\Debug\CoreAudio.dll'. Cannot find or open the PDB file.
{0.0.0.00000000}.{612a18a0-426d-44a5-bfe5-655ee61c2700}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}
{0.0.0.00000000}.{612a18a0-426d-44a5-bfe5-655ee61c2700}|\Device\HarddiskVolume2\Program Files\Steam\Steam.exe%b{00000000-0000-0000-0000-000000000000}
{0.0.0.00000000}.{612a18a0-426d-44a5-bfe5-655ee61c2700}|\Device\HarddiskVolume2\Users\Maria\AppData\Roaming\Spotify\Spotify.exe%b{00000000-0000-0000-0000-000000000000}
The program '[7908] VMTit.vshost.exe' has exited with code -1073741819 (0xc0000005) 'Access violation.
ben kullanıyordum zaman birkaç hafta önce kusursuz çalışması için kullanılan bu kodu. Son zamanlarda W8.1 64bit'den W8.1 32bits'e taşındım. O zamandan beri bu sorun ortaya çıkıyor.
Herhangi bir fikrin var mı?
İstisnai nereden alırsınız? Ayrıca, karıştırıcıyı manipüle etmek yerine neden Spotify API'sini kullanmıyorsunuz? – Luaan
@Luaan, çünkü herhangi bir harici apis kullanmak istemedim, ancak denedim ve harika görünüyor. Teşekkür ederim. – user2530266
@Luaan Soruya cevap olarak yanıtı kabul edebilmem için – user2530266