青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

天行健 君子當自強而不息

用DirectX Audio和DirectShow播放聲音和音樂(7)


本篇是用DirectX Audio和DirectShow播放聲音和音樂(6)的續篇。



加入到MP3的革命中

MP3 是一種音頻壓縮格式,它通過刪除或修改音樂中不易被人耳察覺的部分來使音樂更小,占用的存儲空間更少。在項目中使用MP3(.MP3文件)需要使用 DirectX中的 DirectShow組件,在這個組件的幫助下,只需幾行短短的代碼,就能使用任意的MP3文件了(DirectShow也支持其他的媒體文件,比如 WMA,AVI,MPG等)。當然要想使用更多的媒體文件,必須已經在操作系統中安裝了解碼器。

解碼器(codec)是一個程序,用于解碼或編碼一些指定的格式(比如MP3解碼器專門解碼.MP3文件)。通常可以從發明或者創建這種格式的公司中獲取這種格式的解碼器。比如,MP3解碼器來自于Fraunhofer Insitute。幸運的是,MP3解碼器等幾種比較流行的解碼器已經被集成到操作系統中(比如.mp3,.avi,.mpg等),而無需另外從 internet下載這些格式的解碼器了。

要在項目中使用DirectShow,需要包含dshow.h頭文件,并且在鏈接庫中加入strmiids.lib。



使用DirectShow

DirectX是一組COM接口組件,DirectShow也不例外,DirectShow中經常使用的組件如下:

IGraphBuilder:  幫助建立濾波圖,濾波過濾圖是一組對象或接口的集合,用于處理某種媒體文件。
IMediaControl:控制數據在濾波圖中的流程,使用該接口控制音樂的回放。
IMediaEvents:   從濾波圖中獲取事件及通告,當希望知道在濾波圖中發生了什么的時候這個對象很有用,比如希望知道一個音樂是否仍然在播放或者已經停止播放。

其中第一個接口IGraphBuilder是比較重要的對象,其他對象都依賴于它,或者靠它創建。它創建濾波器,用于處理媒體問題,另外很多有用的功能也是依靠這個對象。

This interface provides methods that enable an application to build a filter graph. The Filter Graph Manager implements this interface.

IGraphBuilder inherits from the IFilterGraph interface. IFilterGraph provides basic operations, such as adding a filter to the graph or connecting two pins. IGraphBuilder adds further methods that construct graphs from partial information. For example, the IGraphBuilder::RenderFile method builds a graph for file playback, given the name of the file. The IGraphBuilder::Render method renders data from an output pin by connecting new filters to the pin.

Using these methods, an application does not need to specify every filter and pin connection in the graph. Instead, the Filter Graph Manager selects filters that are registered on the user's system, adds them to the graph, and connects them. For more information, see Intelligent Connect.

In addition to the methods inherited from IUnknown and IFilterGraph, the IGraphBuilder interface exposes the following methods.

Method Description
Connect Connects two pins. If they will not connect directly, this method connects them with intervening transforms.
Render Adds a chain of filters to a specified output pin to render it.
RenderFile Builds a filter graph that renders the specified file.
AddSourceFilter Adds a source filter to the filter graph for a specific file.
SetLogFile Sets the file for logging actions taken when attempting to perform an operation.
Abort Requests that the graph builder return as soon as possible from its current task.
ShouldOperationContinue Queries whether the current operation should continue.


使用DirectShow播放MP3的第一步是調用 CoCreateInstance函數創建濾波圖對象IGraphBuilder。

    // initialize COM
    //
    // initialize the COM library on the current thread and identifies the concurrency model as single-thread
    // apartment (STA).
    CoInitialize(0);

    
// create the DirectMusic performance object
    //
    // creates a single uninitialized object of the class associated with a specified CLSID.
    if(FAILED(CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, 
                               (
void**)&g_graph_builder)))
    {
        MessageBox(NULL, "Unable to create DirectShow Graph Builder object.", "Error", MB_OK);
        
return FALSE;
    }

一旦創建對象IGraphBuilder成功,就可以請求另兩個接口了:
 
// Query for the media control and event objects
g_graph_builder->QueryInterface(IID_IMediaControl, (void**)&g_media_control);
g_graph_builder->QueryInterface(IID_IMediaEvent, (
void**)&g_media_event);
 

加載媒體文件
 
實際上, DirectShow并不加載媒體文件,而是創建一個DirectShow濾波器到文件的連接。數據在解碼的時候被流化,這樣可以減少在播放過程中的內存使用,創建連接的過程叫做渲染(rendering)。渲染一個文件,需要調用IGraphBuilder::RenderFile函數。

Builds a filter graph that renders the specified file.

Syntax

HRESULT RenderFile(
LPCWSTR lpwstrFile,
LPCWSTR lpwstrPlayList
);

Parameters

lpwstrFile
[in] Pointer to the name of the file containing the data to be rendered.
lpwstrPlayList
[in] Pointer to the playlist name. Reserved; must be NULL. (This parameter is currently unimplemented.)

Return Value

Returns an HRESULT value, which can include one of the following:

  • VFW_S_AUDIO_NOT_RENDERED
  • VFW_S_DUPLICATE_NAME
  • VFW_S_PARTIAL_RENDER
  • VFW_S_RPZA
  • VFW_S_VIDEO_NOT_RENDERED

Remarks

If the lpwstrPlayList parameter is NULL, this method would use the default playlist, which typically renders the entire file.

 

控制音樂的播放

在媒體文件被渲染之后,就可以使用另外兩個接口 IMediaControl和IMediaEvent進行播放或者對播放進行控制了。

第一個接口 IMediaControl用于播放和各種播放相關的操作,這個接口有三個函數:IMediaControl::Run,IMediaControl:: Pause,IMediaControl::Stop。

The IMediaControl interface provides methods for controlling the flow of data through the filter graph. It includes methods for running, pausing, and stopping the graph. The Filter Graph Manager implements this interface. For more information on filter graph states, see Data Flow in the Filter Graph.

IMediaControl also provides Automation-compatible methods for building graphs. Applications written in Microsoft® Visual Basic® can use these methods to construct filter graphs or retrieve information about the graph. Applications written in C or C++ should use the methods in IGraphBuilder and IFilterGraph2 instead, because they are more efficient.

In addition to the methods inherited from IDispatch, the IMediaControl interface exposes the following methods.

Method Description
Run Runs all the filters in the filter graph.
Pause Pauses all filters in the filter graph.
Stop Stops all the filters in the filter graph.
StopWhenReady Pauses the filter graph, allowing filters to queue data, and then stops the filter graph.
GetState Retrieves the state of the filter graph.
RenderFile Builds a filter graph that renders the specified file. (For Visual Basic.)
AddSourceFilter Adds a source filter to the filter graph, for a specified file. (For Visual Basic.)
get_FilterCollection Retrieves a collection of the filters in the filter graph. (For Visual Basic.)
get_RegFilterCollection Retrieves a collection of all the filters listed in the registry. (For Visual Basic.)

 

如果要開始播放一段音樂,調用 IMediaControl::Run就可以了。

Switches the entire filter graph into a running state.

Syntax

HRESULT Run(void); 

Return Value

Returns S_OK if the graph is actually running.

Returns S_FALSE if the graph is preparing to run (the graph will run automatically when it's ready). Call GetState to wait for the transition to the running state to complete or to check if the transition has completed. If the method returns S_FALSE, subsequent calls to GetState will return a value of State_Running when the graph is actually running. If the transition to the running state is not complete GetState can return a return code of VFW_S_STATE_INTERMEDIATE.

Returns an HRESULT error code if the graph could not run and is now stopped.

Remarks

In a running state, data is pushed down the filter graph and rendered. The graph remains in a running state until it is stopped by the IMediaControl::Pause or IMediaControl::Stop method. The graph remains in a running state even after notifying the application of completion (that is, the EC_COMPLETE notification is sent to the application). This allows the application to determine whether to pause or stop after completion.

If the filter graph is in the stopped state, this method first pauses the graph before running.

If an error value is returned, some filters within the graph might have successfully entered the running state. In a multistream graph, entire streams might be playing successfully. The application must determine whether to stop running or not.

一旦播放開始,就可以隨時暫停播放或者停止播放,如果希望暫停播放,調用IMediaControl::Pause函數。

Pauses all the filters in the filter graph.

Syntax

HRESULT Pause(void);

Return Value

Returns S_OK if the graph is actually paused.

Returns S_FALSE if the graph is in paused state but some filters have not completed the transition to pause. Call GetState to wait for the transition to the paused state to complete or to check if the transition has completed. If the method returns S_FALSE, subsequent calls to GetState will return a value of State_Paused when the graph is paused. If the transition to paused is not complete GetState can return a return code of VFW_S_STATE_INTERMEDIATE.

Returns an HRESULT error code if the graph could not transition to paused state and is now stopped.

Remarks

In the paused state, filters process data but do not render it. Data is pushed down the filter graph and is processed by transform filters as far as buffering permits. No data is rendered (except that media types capable of being rendered statically, such as video, have a static, poster frame rendered in paused mode). Therefore, putting a filter graph into a paused state cues the graph for immediate rendering when put into a running state.

開始播放之后,可以隨時調用IMediaContrl::Stop函數來停止播放。

Switches all filters in the filter graph to a stopped state.

Syntax

HRESULT Stop(void); 

Return Value

Returns an HRESULT value.

Remarks

In this mode, filters release resources and no data is processed. If the filters are in a running state, this method pauses them before stopping them. This allows video renderers to make a copy of the current frame for poster frame display while stopped.

以下代碼演示了如何播放MP3文件。
 
//--------------------------------------------------------------------------------
// Play mp3 which specified by filename.
//--------------------------------------------------------------------------------
BOOL Play_MP3(char* filename)
{
    
// convert filename to wide-character string
    WCHAR w_filename[MAX_PATH] = {0};

    mbstowcs(w_filename, filename, MAX_PATH);

    
// render the file
    g_graph_builder->RenderFile(w_filename, NULL);

    
// play the file, switches the entire filter graph into a running state.
    g_media_control->Run();

    
return TRUE;
}
 


檢測播放事件

我們主要感興趣的IMediaEvent函數大概有三個:GetEvent,FreeEventParams,WaitForCompletion。

The IMediaEvent interface contains methods for retrieving event notifications and for overriding the Filter Graph Manager's default handling of events. The IMediaEventEx interface inherits this interface and extends it.

The Filter Graph Manager implements this interface. Applications can use it to respond to events that occur in the filter graph, such as the end of a stream or a rendering error. Filters post events to the filter graph using the IMediaEventSink interface.

For more information about event notification, see Event Notification in DirectShow. For a list of system-defined event notifications, see Event Notification Codes.

In addition to the methods inherited from IDispatch, the IMediaEvent interface exposes the following methods.

Method Description
CancelDefaultHandling Cancels the Filter Graph Manager's default handling for a specified event.
FreeEventParams Frees resources associated with the parameters of an event.
GetEvent Retrieves the next event notification from the event queue.
GetEventHandle Retrieves a handle to a manual-reset event that remains signaled while the queue contains event notifications.
RestoreDefaultHandling Restores the Filter Graph Manager's default handling for a specified event.
WaitForCompletion Waits for the filter graph to render all available data.


第一個函數GetEvent可能是使用最多的函數,它用于找回通知播放狀態的事件。

Retrieves the next notification event.

Syntax

HRESULT GetEvent(
long *lEventCode,
long *lParam1,
long *lParam2,
long msTimeout
);

Parameters

IEventCode
[out] Pointer to the next event notification.
lParam1
[out] Pointer to the first parameter of the event.
lParam2
[out] Pointer to the second parameter of the event.
msTimeout
[in] Time, in milliseconds, to wait before assuming that there are no events.

Return Value

Returns an HRESULT value that depends on the implementation of the interface. If the time-out is zero and no event is waiting, or if the time-out elapses before an event appears, this method returns E_ABORT.

Remarks

The application can pass a time-out value of INFINITE to indicate that the method should block until there is an event; however, applications should avoid using INFINITE. Threads cannot process any messages while waiting in GetEvent. If you call GetEvent from the thread that processes Windows messages, specify only small wait times on the call in order to remain responsive to user input. This is most important when streaming data from a source such as the Internet, because state transitions can take significantly more time to complete.

After calling GetEvent, applications should always call FreeEventParams to release any resource associated with the event.

For a list of notification codes and event parameter values, see Event Notification Codes.

一般我們最希望獲取到的事件是播放完成,這個事件的值是EC_COMPLETE。如果調用GetEvent函數之后,lEventCode的值是 EC_COMPLETE,說明播放完成了。

當獲取并處理了GetEvent產生的事件后,必須把事件所占用的資源釋放,釋放資源使用IMediaEvent::FreeEventParams函數。

Frees resources associated with the parameters of an event.

Syntax

HRESULT FreeEventParams(
long lEventCode,
long lParam1,
long lParam2
);

Parameters

lEventCode
[in] Next event notification.
lParam1
[in] First parameter of the event.
lParam2
[in] Second parameter of the event.

Return Value

Returns an HRESULT value.

Remarks

Event parameters can be of type LONG or BSTR. If a BSTR is passed as an event, it will have been allocated by the task allocator and should be freed using this method. No reference-counted interfaces are passed to an application using IMediaEvent::GetEvent, because these cannot be overridden by IMediaEvent::CancelDefaultHandling. Therefore, do not use this method to release interfaces.

以下代碼演示了如何捕捉事件并釋放事件所占用的資源:
 
        // get th status of the song, it if is done, exit program.

        
long event_code, param1, param2;

        
// retrieves the next notification event
        if(SUCCEEDED(g_media_event->GetEvent(&event_code, &param1, &param2, 1)))
        {
            
if(event_code == EC_COMPLETE)
            {
                
// frees resources associated with the parameters of an events.
                g_media_event->FreeEventParams(event_code, param1, param2);

                
break;
            }                
        }

在需要逐幀連續監視事件的時候,用GetEvent和FreeEventParams組合是很有用的,它能幫助我們獲取事件并作恰當的處理。但當我們需要連續播放而不希望連續監視播放過程的時候,另外一個函數就會很有用,即WaitForCompletion函數。它可以一直播放,在播放完成的時候,會把控制權交給我們。

Blocks execution of the application thread until the graph's operation finishes.

Syntax

HRESULT WaitForCompletion(
long msTimeout,
long *pEvCode
);

Parameters

msTimeout
[in] Duration of the time-out, in milliseconds. Pass zero to return immediately. To block indefinitely, pass INFINITE.
pEvCode
[out] Pointer to the event that terminated the wait. This value can be one of the following:
EC_COMPLETE Operation completed.
EC_ERRORABORT Error. Playback can't continue.
EC_USERABORT User terminated the operation.
Zero Operation has not completed.

Return Value

Returns one of the following HRESULT values.

E_ABORT Function timed out before the operation completed. This is equivalent to a zero pEvCode value.
S_OK Operation completed.
 

Remarks

This method is the equivalent of blocking until the event notification EC_COMPLETE, EC_ERRORABORT, or EC_USERABORT is received, or the time-out occurs.

When this method returns, the filter graph is still running. This method assumes that separate calls to the IMediaEvent interface are not being made. The method fails if the graph is not in, or transitioning into, a running state.

The time-out parameter (msTimeout) specifies the length of time to wait for completion. To test whether the operation completed, specify a zero msTimeout value and check the event code value (pEvCode) for zero, indicating that the operation has not completed.

 

釋放DirectShow資源

一旦播放完成,就要關閉和釋放所有占用的DirectShow資源。
 
    // stop music and relaese DirectShow objects

    // switches all filters in the filter graph to a stopped state.
    g_media_control->Stop();

    g_media_event->Release();
    g_media_event = NULL;

    g_media_control->Release();
    g_media_control = NULL;

    g_graph_builder->Release();
    g_graph_builder = NULL;

下面給出完整的代碼示例,由于DirectX9已經將DirectShow移除,所以需要安裝DirectX8 SDK,并在Vistual Studio中設置頭文件目錄。

點擊下載源碼和工程

 
/***************************************************************************************
PURPOSE:
    MP3 Playing Demo
 ***************************************************************************************/


#include <windows.h>
#include <stdio.h>
#include <dshow.h>
#include "resource.h"

#pragma comment(lib, "dxguid.lib")
#pragma comment(lib, "strmiids.lib")

#pragma warning(disable : 4996)

#define Safe_Release(p) if((p)) (p)->Release();

// window handles, class.
HWND g_hwnd;
char g_class_name[] = "MP3PlayClass";

// DirectShows components
IGraphBuilder*  g_graph_builder = NULL;
IMediaControl*  g_media_control = NULL;
IMediaEvent*    g_media_event   = NULL;

//--------------------------------------------------------------------------------
// Play mp3 which specified by filename.
//--------------------------------------------------------------------------------
BOOL Play_MP3(char* filename)
{
    
// convert filename to wide-character string
    WCHAR w_filename[MAX_PATH] = {0};

    mbstowcs(w_filename, filename, MAX_PATH);

    
// render the file
    g_graph_builder->RenderFile(w_filename, NULL);

    
// play the file, switches the entire filter graph into a running state.
    g_media_control->Run();

    
return TRUE;
}

//--------------------------------------------------------------------------------
// Window procedure.
//--------------------------------------------------------------------------------
long WINAPI Window_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    
switch(msg)
    {
    
case WM_DESTROY:
        PostQuitMessage(0);
        
return 0;
    }

    
return (long) DefWindowProc(hwnd, msg, wParam, lParam);
}

//--------------------------------------------------------------------------------
// Main function, routine entry.
//--------------------------------------------------------------------------------
int WINAPI WinMain(HINSTANCE inst, HINSTANCE, LPSTR cmd_line, int cmd_show)
{
    WNDCLASS            win_class;
    MSG                 msg;    

    
// create window class and register it
    win_class.style         = CS_HREDRAW | CS_VREDRAW;
    win_class.lpfnWndProc   = Window_Proc;
    win_class.cbClsExtra    = 0;
    win_class.cbWndExtra    = DLGWINDOWEXTRA;
    win_class.hInstance     = inst;
    win_class.hIcon         = LoadIcon(inst, IDI_APPLICATION);
    win_class.hCursor       = LoadCursor(NULL, IDC_ARROW);
    win_class.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
    win_class.lpszMenuName  = NULL;
    win_class.lpszClassName = g_class_name;    

    
if(! RegisterClass(&win_class))
        
return FALSE;

    
// create the main window
    g_hwnd = CreateDialog(inst, MAKEINTRESOURCE(IDD_MP3PLAY), 0, NULL);

    ShowWindow(g_hwnd, cmd_show);
    UpdateWindow(g_hwnd);

    
// initialize COM
    //
    // initialize the COM library on the current thread and identifies the concurrency model as single-thread
    // apartment (STA).
    CoInitialize(0);

    
// create the DirectMusic performance object
    //
    // creates a single uninitialized object of the class associated with a specified CLSID.
    if(FAILED(CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, 
                               (
void**)&g_graph_builder)))
    {
        MessageBox(NULL, "Unable to create DirectShow Graph Builder object.", "Error", MB_OK);
        
return FALSE;
    }

    
// Query for the media control and event objects
    g_graph_builder->QueryInterface(IID_IMediaControl, (void**)&g_media_control);
    g_graph_builder->QueryInterface(IID_IMediaEvent, (
void**)&g_media_event);
    
    
// play mp3
    Play_MP3("escape.mp3");
    
    
// start message pump, waiting for signal to quit.
    ZeroMemory(&msg, sizeof(MSG));

    
while(msg.message != WM_QUIT)
    {
        
if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);            
        }             

        
// get th status of the song, it if is done, exit program.

        
long event_code, param1, param2;

        
// retrieves the next notification event
        if(SUCCEEDED(g_media_event->GetEvent(&event_code, &param1, &param2, 1)))
        {
            
if(event_code == EC_COMPLETE)
            {
                
// frees resources associated with the parameters of an events.
                g_media_event->FreeEventParams(event_code, param1, param2);

                
break;
            }                
        }

        
// frees resources associated with the parameters of an events.
        g_media_event->FreeEventParams(event_code, param1, param2);
    }

    
// stop music and relaese DirectShow objects

    // switches all filters in the filter graph to a stopped state.
    g_media_control->Stop();

    g_media_event->Release();
    g_media_event = NULL;

    g_media_control->Release();
    g_media_control = NULL;

    g_graph_builder->Release();
    g_graph_builder = NULL;

    UnregisterClass(g_class_name, inst);

    
// release COM system
    //
    // Closes the COM library on the current thread, unloads all DLLs loaded by the thread, frees any other
    // resources that the thread maintains, and forces all RPC connections on the thread to close.
    CoUninitialize();
    
    
return (int) msg.wParam;
}
 

運行截圖:



posted on 2007-08-04 18:18 lovedday 閱讀(8158) 評論(20)  編輯 收藏 引用

評論

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2007-08-13 22:32 artcpp

非常感謝您的一系列文件,對我自學編程(尤其是Direct方面)起到了很大的引導作用!!謝謝您!  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2007-08-13 22:33 artcpp

不知能否QQ聯系:請教一個DirectShow播放MP3,在個別機器上失敗的奇怪問題。我的QQ:1090833,盼,多謝!!  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2007-08-13 22:52 lovedday

@artcpp
不用客氣,用“你”就好了,用“您”我擔當不起,很高興我的文章能幫到你,這也是我繼續寫技術文章的動力,提高自己的同時還能幫到別人。其實我的水平也很菜的,如果可以幫到你,一定盡力。^_^  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2007-10-04 18:09 bluesea

不知道為什么到 directX 9.0 里,要把 DirectShow 去掉了呢?  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2007-10-07 13:29 lovedday

據說是轉移到win32 sdk去了,可能是DirectShow功能越來越通用,越來越重要的原因。  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7)[未登錄] 2008-01-02 15:42 max

您好~~ 很感謝你的文章, 對我幫助很大, 不過, 我有個問題, 關於只播音訊時, 為什麼不論我用你的方式, 或msdn上的教學, 我的directshow (on mobile 6) 都只能播放出wav檔, 可以給我解感一下嗎?? 需要另外加filter或什麼類的嗎, 不是graphfilter就自動建立基本的filter嗎, 我弄好久了, 我需要能播放midi, mp3, wma.....  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2008-04-06 13:46 wind

很感謝你這一系列啊,我正在做基于DIRECTX的MP3播放系統設計的畢業設計,還有沒有這方面比較好用的資料啊,最好注釋比較淺顯詳盡的,感激不盡啊~~~我的郵箱是coolwind2006@126.com  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2008-04-06 14:03 lovedday

沒了,去買書看看吧,這些東西我也是書上看到的。  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2008-04-21 18:21 淼焱

我有一些問題想請教一下 我的QQ 282338785 謝謝!!  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2008-04-21 18:26 lovedday

隔了這么久了,DirectShow的一些知識我可能都忘了,這樣吧,你給我寫信,我的email是lovedday@gmail.com,看我能不能幫上忙,別說什么請教,我也沒什么經驗的。  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2008-08-18 04:54 lyra

你的東西太好了 謝謝  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2008-10-17 22:12 來來往往

你的資料太好了,謝謝共享  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2008-11-10 01:04 wlxfm

怎樣做一個模擬鍵盤的軟件,用VC++?基于DirectX,就象iDreamPiano一樣。  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2009-05-06 20:05 李平

真的很感謝兄弟啊,這么珍貴的資料,看來自學DirectSound有希望了!!!萬分感激啊!!!  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2009-05-19 00:46 果蠅

太感謝了  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7)[未登錄] 2009-05-19 13:49 李帥

怎么讓這個音樂循環播放?  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2009-09-01 04:54 lyra

非常感謝,看你的資料有兩年了,謝謝您。祝您家庭幸福,身體健康,事業成功。  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2010-01-17 10:09 yinian

非常感謝您這么詳細的介紹,實際上也是一個非常好的教程了。我現在有個疑惑的是,微軟為什么要在DirectX9里面把DirectShow刪除呢,是不是DShow本身存在技術方面的原因,另外,既然新的DirectX中已經沒有DShow了,是不是意味著windows以后的版本對DShow的支持也不會更新了,那么現在使用DShow是不是會以后會碰到一些難以解決的問題呢?  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2013-03-15 17:40

謝謝你的文章,我還有一些具體的問題想問一下,希望能加一下qq:1054359972  回復  更多評論   

# re: 用DirectX Audio和DirectShow播放聲音和音樂(7) 2014-09-27 17:52 CMZ

其實我想問下。通過這些demo可以播放音樂。但是怎么實現循環播放呢?  回復  更多評論   


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


公告

導航

統計

常用鏈接

隨筆分類(178)

3D游戲編程相關鏈接

搜索

最新評論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲福利一区| 国产视频一区在线观看一区免费| 欧美国产亚洲视频| 久久久欧美一区二区| 久久狠狠婷婷| 亚洲免费在线观看视频| 米奇777超碰欧美日韩亚洲| 先锋影音久久久| 久久xxxx| 老色鬼久久亚洲一区二区| 欧美不卡在线视频| 欧美午夜理伦三级在线观看| 国产精品九色蝌蚪自拍| 国产日韩成人精品| 亚洲人成在线播放网站岛国| 最新国产乱人伦偷精品免费网站 | 一区二区欧美日韩| 亚洲女人天堂av| 久久九九热re6这里有精品| 欧美刺激性大交免费视频| 亚洲国产精品传媒在线观看| 亚洲免费观看| 欧美与欧洲交xxxx免费观看| 欧美黄免费看| 国产精品人成在线观看免费| 一区二区三区在线高清| 在线亚洲一区观看| 免费观看欧美在线视频的网站| 亚洲激情国产| 欧美一区二区三区在线观看| 欧美激情欧美狂野欧美精品| 国产日韩精品一区| 亚洲伦理一区| 久久另类ts人妖一区二区| 亚洲乱码国产乱码精品精天堂| 欧美一级久久| 欧美视频福利| 亚洲区免费影片| 麻豆成人av| 午夜在线精品| 欧美日韩精品系列| 影音先锋中文字幕一区二区| 欧美一区二区黄色| 亚洲精品欧洲| 久久综合狠狠综合久久激情| 国产欧美日韩一区二区三区| 99re热精品| 亚洲韩日在线| 久久蜜桃精品| 红桃视频一区| 久久综合九色九九| 久久国产99| 国产精品久久网| 夜夜嗨av色一区二区不卡| 欧美激情精品久久久久| 久久久人成影片一区二区三区观看 | 你懂的视频一区二区| 午夜国产精品影院在线观看 | 欧美 日韩 国产 一区| 亚洲欧美激情四射在线日 | 欧美亚洲一区三区| 亚洲精品中文字幕女同| 欧美精品激情在线| 亚洲天堂av图片| 亚洲精品免费看| 欧美黑人在线播放| 一区二区三区高清在线| 91久久香蕉国产日韩欧美9色| 久久全球大尺度高清视频| 尤物在线观看一区| 欧美成人激情视频免费观看| 蜜桃av综合| 99精品国产一区二区青青牛奶 | 久久精品99无色码中文字幕| 国产欧美日韩三级| 美日韩精品视频免费看| 久久最新视频| 一本色道88久久加勒比精品| 一区二区三区久久久| 国产精品日韩欧美综合| 销魂美女一区二区三区视频在线| 午夜精品福利在线| **性色生活片久久毛片| 亚洲成人自拍视频| 国产精品久久毛片a| 久久综合五月天婷婷伊人| 欧美va亚洲va香蕉在线| 夜夜精品视频一区二区| 亚洲一区二区三区久久| 国产在线精品二区| 91久久国产自产拍夜夜嗨| 国产精品jvid在线观看蜜臀 | 亚洲第一中文字幕| 日韩午夜黄色| 国产精品亚洲成人| 欧美高清hd18日本| 国产精品福利久久久| 久久精品国产综合精品| 欧美国产第一页| 西瓜成人精品人成网站| 久久夜色精品国产欧美乱极品| 亚洲免费高清| 久久成年人视频| 日韩亚洲国产欧美| 欧美一级理论片| 亚洲精品一区二区三区不| 亚洲欧美激情四射在线日 | 亚洲在线观看免费| 亚洲第一在线视频| 亚洲深夜福利视频| 国产精品xxx在线观看www| 欧美亚洲专区| 免费不卡在线观看av| 午夜精品一区二区三区在线| 久久久噜噜噜久久中文字幕色伊伊| 亚洲一区二区三区乱码aⅴ蜜桃女| 欧美一区二区三区免费视| 99热在线精品观看| 欧美在现视频| 亚洲一区中文字幕在线观看| 久久先锋资源| 久久精品首页| 欧美日韩国产小视频| 农村妇女精品| 国模精品一区二区三区色天香| 亚洲免费观看| 亚洲日本中文字幕| 麻豆精品视频| 久久看片网站| 国产自产在线视频一区| 性做久久久久久| 亚洲欧美中文日韩v在线观看| 欧美激情国产精品| 欧美国产高清| 在线观看一区二区精品视频| 午夜精品久久久久久久蜜桃app | 狂野欧美激情性xxxx| 国产欧美在线看| 亚洲主播在线观看| 一区二区精品在线| 欧美精品免费在线观看| 亚洲高清资源| 99在线精品免费视频九九视| 欧美大片在线观看一区| 亚洲电影在线观看| 亚洲精品中文字幕有码专区| 欧美国产日本韩| 亚洲精品一区二区三区福利| 亚洲视频一区在线| 国产精品久久午夜| 欧美一区二区三区四区高清| 久久亚洲一区二区三区四区| 精品成人一区二区| 米奇777超碰欧美日韩亚洲| 亚洲激情社区| 亚洲天堂成人在线视频| 国产精品成人免费| 篠田优中文在线播放第一区| 久久婷婷丁香| 亚洲精品日产精品乱码不卡| 欧美精品在线播放| 亚洲视频1区| 久久国产乱子精品免费女 | 性做久久久久久久久| 国产精品尤物| 欧美中文字幕视频在线观看| 亚洲第一色中文字幕| 亚洲一区二区三区四区视频| 国产日韩欧美精品在线| 欧美国产日本在线| 老牛影视一区二区三区| 亚洲国产精品99久久久久久久久| 欧美一区影院| 欧美二区在线播放| 亚洲一区视频在线观看视频| 国产亚洲网站| 欧美激情偷拍| 欧美亚洲一区二区三区| 亚洲高清在线| 久久精品1区| 亚洲日本va在线观看| 国产精品午夜视频| 欧美—级a级欧美特级ar全黄| 亚洲一级二级| 亚洲高清免费| 久久久最新网址| 午夜视频精品| 亚洲精品视频在线看| 国产三级精品三级| 欧美视频在线观看 亚洲欧| 久久久青草青青国产亚洲免观| 一区二区成人精品| 欧美激情第8页| 久久综合成人精品亚洲另类欧美| 这里只有精品丝袜| 亚洲成人在线视频网站| 国产日韩av高清| 国产精品久久一卡二卡| 欧美人与性动交cc0o| 久久国产视频网|