none
WMVRecompress::LoadCustomProfile() RRS feed

  • 問題

  • 各位好:

     

    在Media SDK中有一個範例程式可載入CustomProfile,請問我想寫一些有關MP3轉PCM或是WMA轉PCM的Profile,是不是可以建議有那些資料可以參考?

     

    感謝答覆

    James

     

    //------------------------------------------------------------------------------
    // Name: CWMVRecompress::LoadCustomProfile()
    // Desc: Loads a custom profile from file.
    //------------------------------------------------------------------------------
    HRESULT CWMVRecompress::LoadCustomProfile( const WCHAR * pwszProfileFile,
                                               IWMProfile ** ppIWMProfile )
    {
        HRESULT             hr = S_OK;
        DWORD               dwLength = 0;
        DWORD               dwBytesRead = 0;
        HANDLE              hFile = INVALID_HANDLE_VALUE;
        IWMProfileManager   * pProfileManager = NULL;
        WCHAR               * pProfile = NULL;

        if( NULL == ppIWMProfile || NULL == pwszProfileFile )
        {
            return( E_POINTER );
        }

        do
        {
            //
            // Create profile manager
            //
            hr = WMCreateProfileManager( &pProfileManager );
            if( FAILED( hr ) )
            {
                break;
            }

            //
            // Open the profile file
            //
            hFile = CreateFileW( pwszProfileFile,
                                 GENERIC_READ,
                                 FILE_SHARE_READ,
                                 NULL,
                                 OPEN_EXISTING,
                                 FILE_ATTRIBUTE_NORMAL,
                                 NULL );
     

    2008年4月11日 上午 01:40

解答