Click here to Skip to main content
15,886,026 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Memory Usage Error Pin
Anu_Bala5-Jul-11 19:52
Anu_Bala5-Jul-11 19:52 
AnswerRe: Memory Usage Error Pin
Malli_S5-Jul-11 21:22
Malli_S5-Jul-11 21:22 
GeneralRe: Memory Usage Error Pin
Anu_Bala5-Jul-11 21:38
Anu_Bala5-Jul-11 21:38 
SuggestionRe: Memory Usage Error Pin
Malli_S5-Jul-11 21:52
Malli_S5-Jul-11 21:52 
QuestionHow many waveInPrepareHeader buffers I need to retrive data from audio device? Pin
Vaclav_5-Jul-11 12:01
Vaclav_5-Jul-11 12:01 
AnswerRe: How many waveInPrepareHeader buffers I need to retrive data from audio device? Pin
Mark Salsbery5-Jul-11 15:25
Mark Salsbery5-Jul-11 15:25 
GeneralRe: How many waveInPrepareHeader buffers I need to retrive data from audio device? Pin
Vaclav_5-Jul-11 16:04
Vaclav_5-Jul-11 16:04 
GeneralRe: How many waveInPrepareHeader buffers I need to retrive data from audio device? Pin
Mark Salsbery5-Jul-11 16:25
Mark Salsbery5-Jul-11 16:25 
Vaclav_Sal wrote:
how does the OS knows about this queue?


The system keeps track of the buffers once you hand them over using waveInAddBuffer()


Vaclav_Sal wrote:
Do I have to do waveInReset before I put it back?


You don't have to do anything, especially don't call waveInReset() which stops recording and releases all the buffers.


Vaclav_Sal wrote:
What will happen if I screw up and run out of buffers?


Gaps in the audio maybe? I'm not sure - you may have to look that up, or try recording with one buffer and see what happens Smile | :)


Vaclav_Sal wrote:
I cannot find anywhere how did the paramater1 became the WAVEHDR pointer.


Documented![^]. Yes it may be a common API design in Win32, but isn't related to anything else.


Vaclav_Sal wrote:
I am obviously getting   "buffer full" by executing the callback


YOU shouldn't be executing the callback. Callbacks are called by the system, which is why they are called callbacks Smile | :) If you are calling it then that's wrong!

In your callback function, check the message. If it's WIM_DATA then check the flags in the WAVEHDR struct. If the WHDR_DONE flag is set then waveInReset was called so don't add the buffer back in. Else look at the dwBytesRecorded value for how many bytes are there. I suppose if it's 0 just put it back in with waveInAdd.

If the format is wrong then you should know that when you call waveInOpen() - long before you set up buffers.
Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: How many waveInPrepareHeader buffers I need to retrive data from audio device? Pin
Vaclav_6-Jul-11 13:18
Vaclav_6-Jul-11 13:18 
GeneralRe: How many waveInPrepareHeader buffers I need to retrive data from audio device? Pin
Mark Salsbery6-Jul-11 13:28
Mark Salsbery6-Jul-11 13:28 
GeneralRe: How many waveInPrepareHeader buffers I need to retrive data from audio device? Pin
Vaclav_6-Jul-11 15:29
Vaclav_6-Jul-11 15:29 
QuestionHow to?? Pin
john56325-Jul-11 3:08
john56325-Jul-11 3:08 
AnswerRe: How to?? [modified] Pin
Rajesh R Subramanian5-Jul-11 3:30
professionalRajesh R Subramanian5-Jul-11 3:30 
QuestionRe: How to?? Pin
CPallini5-Jul-11 3:41
mveCPallini5-Jul-11 3:41 
AnswerRe: How to?? Pin
Rajesh R Subramanian5-Jul-11 3:44
professionalRajesh R Subramanian5-Jul-11 3:44 
GeneralRe: How to?? Pin
ThatsAlok5-Jul-11 23:19
ThatsAlok5-Jul-11 23:19 
GeneralRe: How to?? Pin
Rajesh R Subramanian6-Jul-11 4:06
professionalRajesh R Subramanian6-Jul-11 4:06 
AnswerRe: How to?? Pin
CPallini5-Jul-11 3:35
mveCPallini5-Jul-11 3:35 
Questionwhat is the maximum combination for generate random string of given length? Pin
Le@rner5-Jul-11 0:40
Le@rner5-Jul-11 0:40 
AnswerRe: what is the maximum combination for generate random string of given length? Pin
Rajesh R Subramanian5-Jul-11 0:55
professionalRajesh R Subramanian5-Jul-11 0:55 
AnswerRe: what is the maximum combination for generate random string of given length? Pin
T.RATHA KRISHNAN5-Jul-11 1:03
T.RATHA KRISHNAN5-Jul-11 1:03 
AnswerRe: what is the maximum combination for generate random string of given length? Pin
enhzflep5-Jul-11 1:53
enhzflep5-Jul-11 1:53 
QuestionRegarding - Compression and uncompression algarthm source code in c Pin
Jayasreeg4-Jul-11 23:32
Jayasreeg4-Jul-11 23:32 
AnswerRe: Regarding - Compression and uncompression algarthm source code in c Pin
Richard MacCutchan5-Jul-11 0:16
mveRichard MacCutchan5-Jul-11 0:16 
AnswerRe: Regarding - Compression and uncompression algarthm source code in c Pin
Chris Losinger5-Jul-11 5:17
professionalChris Losinger5-Jul-11 5:17 

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.