Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. About the WAV to WMA of audio ?

About the WAV to WMA of audio ?

Scheduled Pinned Locked Moved C / C++ / MFC
comhelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zhaopzhi
    wrote on last edited by
    #1

    I wrote a code of WAV(C:\\InputFile.wav) to WMA(C:\\OutputFile.wma) of the audio,but it was distempered.Please give a help,thank you in advance. The following is my code: // Include libraries. #include #include #include #include "D:\WMSDK\WMEncSDK9\include\wmencode.h" #include // for kbhit() void main() { // Declare variables. HRESULT hr; IWMEncoder* pEncoder; IWMEncSourceGroupCollection* pSrcGrpColl; IWMEncSourceGroup* pSrcGrp; IWMEncSource* pSrc; IWMEncVideoSource* pSrcVid; IWMEncAudioSource* pSrcAud; IPropertyBag* pPropertyBag; IWMEncProfileCollection* pProColl; IWMEncProfile* pPro; IWMEncFile* pFile; IWMEncAttributes* pAttr; IWMEncDisplayInfo* pDispInfo; CComBSTR bstrName = NULL; long lCount; int i; // Initialize the COM library and retrieve a pointer to an IWMEncoder interface. hr = CoInitialize(NULL); if ( SUCCEEDED( hr ) ) { hr = CoCreateInstance(CLSID_WMEncoder, NULL, CLSCTX_INPROC_SERVER, IID_IWMEncoder, (void**) &pEncoder); } // Retrieve the source group collection. if ( SUCCEEDED( hr ) ) { hr = pEncoder->get_SourceGroupCollection(&pSrcGrpColl); } // Add a source group to the collection. if ( SUCCEEDED( hr ) ) { hr = pSrcGrpColl->Add(CComBSTR("SG_1"), &pSrcGrp); } if ( SUCCEEDED( hr ) ) { hr = pSrcGrp->AddSource(WMENC_AUDIO, &pSrc); } if ( SUCCEEDED( hr ) ) { hr = pSrc->QueryInterface(IID_IWMEncAudioSource, (void**)&pSrcAud); } if ( SUCCEEDED( hr ) ) { hr = pSrcAud->SetInput(CComBSTR("C:\\InputFile.wav")); } // Specify a file object in which to save encoded content. if ( SUCCEEDED( hr ) ) { hr = pEncoder->get_File(&pFile); } if ( SUCCEEDED( hr ) ) { hr = pFile->put_LocalFileName(CComBSTR("C:\\OutputFile.wma")); } // Retrieve a pointer to the property bag. if ( SUCCEEDED( hr ) ) { hr = pSrcAud->QueryInterface(IID_IPropertyBag, (void**)&pPropertyBag); } // Choose a profile from the collection. if ( SUCCEEDED( hr ) ) { hr = pEncoder->get_ProfileCollection(&pProColl); } if ( SUCCEEDED( hr ) ) { hr = pProColl->get_Count(&lCount); } for (i=0; i

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups