| Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате |
| Форум программистов > Работа со звуком > Получение уведомлений от звукового буфера |
| Автор: Свирепый 12.11.2006, 00:29 |
| HRESULT InitNotifications() { HRESULT hr; if( NULL == g_pDSBCapture ) return E_FAIL; // Create a notification event, for when the sound stops playing if( FAILED( hr = g_pDSBCapture->QueryInterface( IID_IDirectSoundNotify, (VOID**)&g_pDSNotify ) ) ) return DXTRACE_ERR_MSGBOX( TEXT("QueryInterface"), hr ); // Setup the notification positions for( INT i = 0; i < NUM_REC_NOTIFICATIONS; i++ ) { g_aPosNotify[i].dwOffset = (g_dwNotifySize * i) + g_dwNotifySize - 1; g_aPosNotify[i].hEventNotify = g_hNotificationEvent; } // Tell DirectSound when to notify us. the notification will come in the from // of signaled events if( FAILED( hr = g_pDSNotify->SetNotificationPositions( NUM_REC_NOTIFICATIONS, g_aPosNotify ) ) ) return DXTRACE_ERR_MSGBOX( TEXT("SetNotificationPositions"), hr ); return S_OK; } создается второй поток с функцией WaitForSingleObject(). Сообщение от буфера поступает всего один раз(в самом начале). потом -- тишина. Может кто знает где можно поискать ошибку? |
| Автор: Свирепый 12.11.2006, 14:30 |
| уже разобрался) |