![]() |
AW: TAudioVolume Komponente incl. System Mixer
Zitat:
![]() Das spuckt für oben zitierten Abschnitt folgendes aus: Zitat:
|
AW: TAudioVolume Komponente incl. System Mixer
Zitat:
Aber zur not tat er es auch. Habe gesehen du hast SysProp2 deaktiviert.. nur zur Info das funktioniert nicht mit D2010 da ist SysProp fehlerhaft. gruss |
AW: TAudioVolume Komponente incl. System Mixer
Zitat:
|
AW: TAudioVolume Komponente incl. System Mixer
Zitat:
Ein Flag kann da wunder wirken.
Delphi-Quellcode:
{$IFDEF VER210} PropSys2 {$ELSE} PropSys {$ENDIF}
Habe es addiert. gruss |
AW: TAudioVolume Komponente incl. System Mixer
Kleines Update..
PeakMeter gefixt. GetMasterPeaks addiert GetSessionPeaks addiert Die Peaks werden jetzt abhängig vom Mute Status oder der Lautstärke OUTLINE, FILLED gezeichnet.
Delphi-Quellcode:
So muss man in der Anwendung selbst sich nicht mehr darum kümmern.
procedure TAudioVolume.GetMasterPeaks(var Master, MasterL, MasterR: Integer);
begin if Assigned(MasterMeter) then begin Master := MasterMeterPeak; MasterL := MasterMeterPeakL; MasterR := MasterMeterPeakR; end; end; Kümmere mich jetzt um die Events. gruss |
AW: TAudioVolume Komponente incl. System Mixer
Zitat:
Wegen deinem Trick.. Du weist aber schon das ich genau das schon mache? Hmmm....
Delphi-Quellcode:
gruss
// We can get session enumerator if we use Windows 7 or newer system.
if (Win32MajorVersion > 6) or ((Win32MajorVersion = 6) and (Win32MinorVersion >= 1)) then begin // Get the session manager2 for the endpoint device. HR := Device.Activate(IID_IAudioSessionManager2, CLSCTX_ALL, nil, IUnknown(SessionManager2)); if HR <> S_OK then raise Exception.Create('Error : Unable to get AudioSessionManager2 Interface'); // Register TAudioSessionNotification to receive a notification when a session is created. HR := SessionManager2.RegisterSessionNotification(self); if HR <> S_OK then raise Exception.Create('Error : Unable to Register Session Notification'); // Get the session enumerator HR := SessionManager2.GetSessionEnumerator(SessionEnumerator); // <<<<<<<< if HR <> S_OK then raise Exception.Create('Error : Unable to get SessionEnumerator Interface'); end; |
AW: TAudioVolume Komponente incl. System Mixer
Hälst du denn die Instanz davon irgendwo oder wird die bei jeden Aufruf überschrieben?
Ist das eine der Methoden, der man eine IMMDevice-Instanz hineingibt? So dass immer wieder neu GetSessionEnumerator aufgerufen wird? Vergleiche mal mein Beispielprogramm wenn man GetSessionEnumerator auskommentiert. Wenn auskommentiert: Kein OnSessionCreated. Wenn einkommentiert: OnSessionCreated wird befeuert! |
AW: TAudioVolume Komponente incl. System Mixer
Zitat:
Unregistriert und neu registriert für das aktuelle Device.
Delphi-Quellcode:
Was ich mir vorstellen könnte das es an der falschen Position initialisiert wird.
function TAudioVolume.SetupDefaultAudioEndpoint(Device_Enumerator: IMMDeviceEnumerator): boolean;
var HR: HResult; MDevice: IMMDevice; hnsRequestedDuration: REFERENCE_TIME; pwfx: PWAVEFORMATEX; begin Result := false; try // Get default audio endpoint device with the specified data-flow direction (eRender or eCapture) // and device role. HR := Device_Enumerator.GetDefaultAudioEndpoint(eRender, eMultimedia, MDevice); if HR <> S_OK then raise Exception.Create('Error : Unable to get DefaultAudioEndpoint Device'); FDefaultDevice := GetDeviceInfo(MDevice); Device := MDevice; // Get the session manager for the endpoint device. HR := Device.Activate(IID_IAudioSessionManager, CLSCTX_INPROC_SERVER, nil, IUnknown (SessionManager)); if HR <> S_OK then raise Exception.Create('Error : Unable to get AudioSessionManager Interface'); // **** Get the IChannelAudioVolume interface : HR := Device.Activate(IID_IAudioClient, CLSCTX_ALL, nil, IUnknown(AudioClient)); if HR <> S_OK then raise Exception.Create('Error : Unable to get AudioClient Interface'); hnsRequestedDuration := REFTIMES_PER_SEC; HR := AudioClient.GetMixFormat(pwfx); if HR <> S_OK then raise Exception.Create( 'Error : Unable to retrieves the stream format that the audio engine uses'); HR := AudioClient.Initialize(AUDCLNT_SHAREMODE_SHARED, 0, hnsRequestedDuration, 0, pwfx, nil); if HR <> S_OK then raise Exception.Create('Error : Unable to initialize AudioClient Interface'); HR := AudioClient.GetService(IID_IChannelAudioVolume, IUnknown(ChannelAudioVolume)); if HR <> S_OK then raise Exception.Create('Error : Unable to get ChannelAudioVolume Interface'); // get SimpleAudioVolume HR := SessionManager.GetSimpleAudioVolume(nil, 0, SimpleAudioVolume); if HR <> S_OK then raise Exception.Create('Error : Unable to get SimpleAudioVolume Interface'); // Get the control interface for the process-specific audio session. HR := SessionManager.GetAudioSessionControl(nil, false, SessionControl); if HR <> S_OK then raise Exception.Create('Error : Unable to get AudioSessionControl'); // Register IAudioSessionEvents interface to receive notifications when session events occur. HR := SessionControl.RegisterAudioSessionNotification(self); if HR <> S_OK then raise Exception.Create('Error : Unable to Register Session Notification Event'); // We can get session enumerator if we use Windows 7 or newer system. if (Win32MajorVersion > 6) or ((Win32MajorVersion = 6) and (Win32MinorVersion >= 1)) then begin // Get the session manager2 for the endpoint device. HR := Device.Activate(IID_IAudioSessionManager2, CLSCTX_ALL, nil, IUnknown(SessionManager2)); if HR <> S_OK then raise Exception.Create('Error : Unable to get AudioSessionManager2 Interface'); // Register TAudioSessionNotification to receive a notification when a session is created. HR := SessionManager2.RegisterSessionNotification(self); if HR <> S_OK then raise Exception.Create('Error : Unable to Register Session Notification'); // Get the session enumerator HR := SessionManager2.GetSessionEnumerator(SessionEnumerator); if HR <> S_OK then raise Exception.Create('Error : Unable to get SessionEnumerator Interface'); end; Result := true; finally end; end; gruss |
AW: TAudioVolume Komponente incl. System Mixer
Zitat:
Zitat:
Halte dir testhalber mal die Instanzen von Device, SessionManager2 und SessionEnumerator in einer oder mehreren Listen. Siehe Beispielprogramm. Vielleicht geht es dann. |
AW: TAudioVolume Komponente incl. System Mixer
Zitat:
Zitat:
Aber kann es nochmals testen. Danke. EDIT: Da ist kein Unterschied.. Im Moment ist die Luft raus muss mal ein paar Tage pause machen... komme zu keinen Ergebnis. Bei dir geht es warum auch immer. gruss |
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:53 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz