Click here to Skip to main content
15,888,908 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++ code to create thread to handle method Pin
pasztorpisti3-Sep-13 22:00
pasztorpisti3-Sep-13 22:00 
GeneralRe: C++ code to create thread to handle method Pin
Erudite_Eric4-Sep-13 4:47
Erudite_Eric4-Sep-13 4:47 
GeneralRe: C++ code to create thread to handle method Pin
pasztorpisti4-Sep-13 4:51
pasztorpisti4-Sep-13 4:51 
GeneralRe: C++ code to create thread to handle method Pin
Erudite_Eric5-Sep-13 21:33
Erudite_Eric5-Sep-13 21:33 
GeneralRe: C++ code to create thread to handle method Pin
pasztorpisti5-Sep-13 22:38
pasztorpisti5-Sep-13 22:38 
AnswerRe: C++ code to create thread to handle method Pin
Erudite_Eric3-Sep-13 3:50
Erudite_Eric3-Sep-13 3:50 
AnswerRe: C++ code to create thread to handle method Pin
Eytukan6-Sep-13 2:49
Eytukan6-Sep-13 2:49 
QuestionProblem playing (rendering) wave file using WASAPI Pin
AmbiguousName1-Sep-13 19:25
AmbiguousName1-Sep-13 19:25 
Hello. I am trying to play a wave stream through WASAPI. I am trying to use the code available in online msdn. Here is what I am trying.
C++
hResult = pAudioClient->Initialize(AUDCLNT_SHAREMODE_SHARED, 0, 1000000000, 0, pWaveFormatEx, NULL);
if(FAILED(hResult)) return;

UINT nTotalBufferSize = 0;
pAudioClient->GetBufferSize(&nTotalBufferSize);

IAudioRenderClient *pAudioRenderClient = GetRenderClient(pAudioClient);

BYTE* pData = NULL;
hResult = pAudioRenderClient->GetBuffer(nTotalBufferSize, &pData); // get all the buffer

hResult = pAudioClient->GetService(IID_IAudioRenderClient, (void**)&pAudioRenderClient);
if(FAILED(hResult)) return;

::memcpy(pData, pDataPCM, nTotalBufferSize);

hResult = pAudioRenderClient->ReleaseBuffer(nTotalBufferSize, 0);

hResult = pAudioClient->Start(); // Start Playing

DWORD dwFlags = 0;

while(TRUE)
{
    ::Sleep(500);

    UINT nFramesPadding = 0, nFramesAvailable;
    hResult = pAudioClient->GetCurrentPadding(&nFramesPadding);

            /* HERE I MEANT TO DO SOMETHING TO LISTEN TO THIS BUFFER */

    TRACE("%d\n", nFramesPadding);
}

hResult = pAudioClient->Stop();


I am NOT getting any error but I cannot listen to the buffer as well. So what should I do in the loop to listen to this buffer? Thanks.

This world is going to explode due to international politics, SOON.


modified 2-Sep-13 1:33am.

QuestionMFCPropertyGridProperty masked edit control Pin
Richard Andrew x641-Sep-13 18:02
professionalRichard Andrew x641-Sep-13 18:02 
AnswerRe: MFCPropertyGridProperty masked edit control Pin
D G McKay1-Sep-13 23:17
D G McKay1-Sep-13 23:17 
GeneralRe: MFCPropertyGridProperty masked edit control Pin
Richard Andrew x641-Sep-13 23:35
professionalRichard Andrew x641-Sep-13 23:35 
Generalabout destructor Pin
Syeda Fatimah30-Aug-13 21:40
Syeda Fatimah30-Aug-13 21:40 
GeneralRe: about destructor Pin
Richard MacCutchan30-Aug-13 21:57
mveRichard MacCutchan30-Aug-13 21:57 
GeneralRe: about destructor Pin
«_Superman_»31-Aug-13 22:58
professional«_Superman_»31-Aug-13 22:58 
GeneralRe: about destructor Pin
Ajay_Tiwari3-Sep-13 0:40
Ajay_Tiwari3-Sep-13 0:40 
GeneralRe: about destructor Pin
Erudite_Eric3-Sep-13 3:47
Erudite_Eric3-Sep-13 3:47 
GeneralRe: about destructor Pin
Ajay_Tiwari15-Sep-13 18:43
Ajay_Tiwari15-Sep-13 18:43 
GeneralRe: about destructor Pin
Erudite_Eric3-Sep-13 3:47
Erudite_Eric3-Sep-13 3:47 
QuestionUsing CDHtmlDialog Pin
Don Guy30-Aug-13 12:58
Don Guy30-Aug-13 12:58 
AnswerRe: Using CDHtmlDialog Pin
Richard MacCutchan30-Aug-13 21:56
mveRichard MacCutchan30-Aug-13 21:56 
GeneralRe: Using CDHtmlDialog Pin
SoMad30-Aug-13 22:20
professionalSoMad30-Aug-13 22:20 
GeneralRe: Using CDHtmlDialog Pin
Richard MacCutchan30-Aug-13 22:40
mveRichard MacCutchan30-Aug-13 22:40 
GeneralRe: Using CDHtmlDialog Pin
Don Guy2-Sep-13 6:25
Don Guy2-Sep-13 6:25 
GeneralRe: Using CDHtmlDialog Pin
Richard MacCutchan2-Sep-13 21:29
mveRichard MacCutchan2-Sep-13 21:29 
QuestionHow to write vector destructor? Pin
CryptoGnome329-Aug-13 15:36
CryptoGnome329-Aug-13 15:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.