 |
|
 |
This is outstanding work!
|
|
|
|
 |
|
 |
void CSoundBase::Update()
{
m_Format.nAvgBytesPerSec = m_Format.nSamplesPerSec*(m_Format.wBitsPerSample/8);
m_Format.nBlockAlign = m_Format.nChannels *(m_Format.wBitsPerSample/8);
}
Above calculations of parameters in WAVEFORMATEX are, assumedly, wrong.
An implementation along the MSDN description is below.
void CSoundBase::Update()
{
m_Format.nBlockAlign = (m_Format.nChannels * m_Format.wBitsPerSample) / 8;
m_Format.nAvgBytesPerSec = m_Format.nSamplesPerSec * m_Format.nBlockAlign;
}
|
|
|
|
 |
|
 |
Hi dear,
I am using the winmm.lib to record audio device.
I want to record with fix period time(e.g 60ms) but I get the variable
period of recording(e.g. 47,62,78,47,62,78,. . .).
How can I solve this problem?
Thanks
modified on Wednesday, August 3, 2011 2:40 AM
|
|
|
|
 |
|
 |
there is a file ma,e soundfile.cpp, here there is a function mmioWrite that is being used, how do I change the m_hFIle variable to something like an array where I can store the byte and save the recorded voice into .txt format. ANy sugestions, thanks in advance.
|
|
|
|
 |
|
 |
Thank you for this code, it has been very useful. I have had problems when playing one file after another in rapid succession with it hanging after a random number of calls. I presume that this is because the device is not ready. Is there a solution?
|
|
|
|
 |
|
 |
Just wondering what technique did you use.. MCI or directX? internally
Muhammad Adnan
Software Engineer (.NET)
|
|
|
|
 |
|
|
 |
|
 |
Hello. I was working on a C# program for reading a data through a sound card in .wav form. I wanted for the sound card to automatically start recording the data upon arrival and these store /pass it for manipulation.
thank you for the help in advance. --fun is the way of life--L.Z
I have fun coding using c# + c++
|
|
|
|
 |
|
 |
Greetings.
Can anyone please help me on how to modify the source code so that when you play a wav file, the playback would loop continuously until I set it to stop.
Your help would be greatly appreciated, thank you.
->Demsen
|
|
|
|
 |
|
 |
I do this via ::PlaySound( m_csAudio, 0, SND_ASYNC|SND_NODEFAULT|SND_LOOP/*Repeat Flag*/ )
Greetings from Germany
|
|
|
|
 |
|
 |
hi:
can anyone tell me what's going wrong?
i download the demo and source zip file from this website, but why i could't open the file?
i click on the "fister.dsw" to try to open the source code in workspace...is it correct?
what should i do?
|
|
|
|
 |
|
 |
if u r able to open workspace compile it in any mode and run exe
|
|
|
|
 |
|
 |
hi,
initially when i tried it, i got the error
WaveIn21:Cannot perform this operation when the media is still playing.Reset the deviceor wait untill the stop().
but after sometime it automatically started work. now it's not recording anything from microphone. it's creating a blank sound file.
can anybody help me in it.
thanks
praveen
|
|
|
|
 |
|
 |
Hi!
these 2 errors r generated wen i build ur project:
error C2065: 'StartRecordingToFile' : undeclared identifier
error C2065: 'StopRecordingToFile' : undeclared identifier
tell me y these errors r generated n how can i remove them in ur project!!!!!
|
|
|
|
 |
|
 |
the first dialog class is inherited from cpipe and cdialog.
life is like a pack of chaocolite
|
|
|
|
 |
|
 |
Hi!
tell me that SoundIn,soundout,pipe,ptrfifo,soundbase,soundfile ....u wrote the code of these source files n header files by urslf or u find it built in VC++ MFC!!! n what u mean by they r the wrapper classes.... I m new to VC++ so guide me... how can i import these files into my project,tell me methods other than copy n paste!!! is there any other method!!!
Faisal
|
|
|
|
 |
|
 |
Hi,
i have executed the program but unable to play because it give to messages
WaveIn21:Cannot perform this operation when the media is still playing.Reset the deviceor wait untill the stop().
it also give another message that 3 buffer wait in queue.
please help as i am badly need of it.
|
|
|
|
 |
|
 |
Hi,
I solved this problem using a critical section to make
- the call to waveInReset, and
- the set m_bRecording = FALSE
an atomic action. To make the story short:
1. Add a CRITICAL_SECTION m_cs into CSoundIn class.
2. Add InitializeCriticalSection( &m_cs ) into CSoundIn constructor
3. Add DeleteCriticalSection( &m_cs ); into CSoundIn destructor.
4. Add a new method:
BOOL CSoundIn::ImRecording( void )
{
BOOL recording;
EnterCriticalSection( &m_cs );
recording = m_bRecording;
LeaveCriticalSection( &m_cs );
return recording;
}
5. In void CSoundIn::OnMM_WIM_DATA(UINT parm1, LONG parm2) change:
- if( m_bRecording )
with:
- if( ImRecording() )
6. Finally, in void CSoundIn::Stop() modify your code as follows:
...
EnterCriticalSection( &m_cs );
mmReturn = ::waveInReset(m_hRecord);
if(mmReturn)
{
waveInErrorMsg(mmReturn, "in Stop()");
LeaveCriticalSection( &m_cs );
return;
}
else
{
m_bRecording = FALSE;
LeaveCriticalSection( &m_cs );
...
I hope this helps you!
P.
|
|
|
|
 |
|
 |
thanks for the solution... i had the same problem
|
|
|
|
 |
|
 |
as if it can solve ,thanks very much for your code.
|
|
|
|
 |
|
 |
I need a win32 API to set the default recording device for windows. Do you know?
PLease help me? Tks!!!!
|
|
|
|
 |
|
 |
I don't understand why you only send 3 times on SoundCard by waveoutWrite and 2000 bytes per time.But you can play file "Sine" which has length 90000 bytes.
There is your code :
for(int i=0; i<3; i++)
{
CBuffer buf(m_Format.nBlockAlign*m_BufferSize, false);
GetDataToSoundOut(&buf, m_pOwner);
AddOutputBufferToQueue(&buf);
}
|
|
|
|
 |
|
 |
take attention to the callback function: GetDataToSoundOut, it will fill in the new buffers to play continuely.
|
|
|
|
 |
|
 |
Thank you for your advice.
|
|
|
|
 |
|
 |
if we want to record sound in d fister program
without using play , record button but using indiactor soubnd
how can we proceed?
|
|
|
|
 |