1

Please advice whether it's possible to programmatically change global audio balance (left/right volume). I've tried the SetBalance method but it doesn't change audio balance in currently playing audio stream (using standard media player app) The codebelow is what I pasted to some sample WP8 app. (No, it didn't work)

 Microsoft::WRL::ComPtr<IMFMediaEngineClassFactory> spFactory;
 Microsoft::WRL::ComPtr<IMFAttributes> spAttributes;
 CoCreateInstance(CLSID_MFMediaEngineClassFactory, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&spFactory));

 Microsoft::WRL::ComPtr<IMFMediaEngine> m_spMediaEnine;
 Microsoft::WRL::ComPtr<IMFMediaEngineEx> m_EnineEx;

 //MFCreateAttributes(&spAttributes, 1);

 const DWORD flags = MF_MEDIA_ENGINE_WAITFORSTABLE_STATE;

 spFactory->CreateInstance(flags, spAttributes.Get(), &m_spMediaEnine);
 m_spMediaEnine.Get()->QueryInterface(__uuidof(IMFMediaEngine), (void **) &m_EnineEx);
 HRESULT res = m_EnineEx->SetBalance(-1.0);

Thanks in advance!

UPD: Is this method appliable solely for "My" sound stream i.e. the one I've created f.e. in my own music player? And is this method has nothing to do with sound streams not owned by my app?

4

0 回答 0