 |
|
 |
Work well in Windows XP,but crashed in Windows 7 when recording end.
Anybody can resolve it?
modified 28 Apr '12.
|
|
|
|
 |
|
 |
Why lpBuffer1 is allocated 16384 size? Can I allocate size other than 16384
|
|
|
|
 |
|
|
 |
|
 |
simple and usefull
|
|
|
|
 |
|
 |
i want to play audio directly without recording.
i mean i dont need to record and play, get audio from input device and then play it simultaniously.
|
|
|
|
 |
|
 |
Any wayz thanks dude for ur support . but i could not play with sample rate of 8000 it is giving "Attempted to open with an unsupported waveform-audio format" error. so i tried with 44100 here it's fine but song is playing very fast y?
and one more issue is it cannot allocate the next buffer if we want to record for more time.
thanks once more...
|
|
|
|
 |
|
 |
When I save the file.wav if I rec for long long time (about 15 minutes) I see that my file is shorter than should be, I think it lost some part during reallocation og new buffer, here:
lpNewBuffer = (char *)realloc(lpSaveBuffer,dwDataLength + ((PWAVEHDR)dwParam1)->dwBytesRecorded);
someone have a solution?
Thanks a lot
keggy
|
|
|
|
 |
|
 |
when i run the program i get LINKING ERRORS plz help me and give proper steps to run the cpp file
dgwefwqe
|
|
|
|
 |
|
 |
Hi,
I would like to ask you for assistance.
My project requires me to record audio from a website.
I would like to ask if it is possible to make a C++ code work from there.
Its urgent if anyone can help me please.
Thanks
Jan
|
|
|
|
 |
|
 |
Hii,
Is there a way to save the audio file after recording?
Thank you.
|
|
|
|
 |
|
 |
to save it tries this,
i use this struct:
typedef struct{
char RIFF[4];
DWORD bytes;
char WAVE[4];
char fmt[4];
int siz_wf;
WORD wFormatTag;
WORD nChannels;
DWORD nSamplesPerSec;
DWORD nAvgBytesPerSec;
WORD nBlockAlign;
WORD wBitsPerSample;
char data[4];
DWORD pcmbytes;
} WAVHEADER;
// code that use to save
WAVHEADER wh;
memcpy(wh.RIFF,"RIFF",4);
wh.bytes = blockSize+36;
memcpy(wh.WAVE,"WAVE",4);
memcpy(wh.fmt,"fmt ",4);
wh.siz_wf=16;
memcpy(wh.data,"data",4);
wh.pcmbytes = blockSize;
wh.wFormatTag = waveform.wFormatTag;
wh.nChannels = waveform.nChannels;
wh.nSamplesPerSec = waveform.nSamplesPerSec;
wh.nAvgBytesPerSec = waveform.nAvgBytesPerSec;
wh.nBlockAlign = waveform.nBlockAlign;
wh.wBitsPerSample = waveform.wBitsPerSample;
HANDLE hFile = CreateFile("audio.wav", // file to create
GENERIC_WRITE, // open for writing
0, // do not share
NULL, // default security
CREATE_ALWAYS, // overwrite existing
FILE_ATTRIBUTE_NORMAL, // normal file
NULL);
WriteFile(hFile,(char*)&wh,sizeof(WAVHEADER),&bWrite,NULL);
WriteFile(hFile,block,blockSize,&bWrite,NULL);
CloseHandle(hFile);
i need improve this
|
|
|
|
 |
|
 |
if yo add de bWrite declaration, it works well.
DWORD bWrite;
|
|
|
|
 |
|
 |
I don't undrestand where I should add all this code?
|
|
|
|
 |
|
 |
My problem is i am also successful in recording a voice ..
but now i want to send that recorded sound using a socket connection means i want to send a recorded file from one client to another ...
Is there any way and also i am facing a problem of two emulators in a network connection...
my email ID is :shailesh_96@yahoo.co.in
if you find a solution on that then let me know in as early as possible ...matter urgent...
|
|
|
|
 |
|
 |
This example code is well written and illustrates a difficult piece of the Win32 SDK. When writing code for distribution to millions of end-users with a variety of Windows versions, the basic Win32 API is still the most reliable way to do recording and playback of sound. Not everyone has ActiveX.
pg
|
|
|
|
 |
|
 |
HI DUDE
HEY THE ARTICLE AND THE EXAMPLE IS VERY GOOD
BUT I NEED 2 THINGS THAT ALREADY SOMEBODY DID ASK TO YOU
HOW CAN I WRITE THE .WAV FILE
YOU SAID THAT I CAN USE FOPEN, FWRITE, FCLOSE
I REALLY DONT KNOIW HOW TO USE THAT, CAN YOU HELP ME.
AND ALSO YOU SAID THAT THE CALLBACK FUNCTIONS REPEATS EVERY TIME THE BUFFER IS FULL, IF I WRITE THE FILE EACH TIME THE BUFFER IS FULL, I WILL HAVE MY .WAV FILE. LIKE A LOT OF FILES
HOW CAN I WRITE JUST 1 FILE,
DO YOU HAVE THE CODE FOR THAT, CAN YOU WRITE THE FUNCTION AND EXPLAIN TO ME HOW TO USE IT ????
MY OTHER QUESTION IS THAT I MUST TO SEND THE .WAV FILE THROUGH A SOCKET
SO I GAVE SOCKETS SUPPORT FOR THE APP , BUT I DONT KNOW HOW TO SEND ???
USING THE SEND FUNCTION CAN YOU EXPLAIN TO ME ???
DO YOU THINK THAT IS BETTER TO WRITE THE WAV FILE AND THEN WHEN I FINISH THAT , THEN TO SEND ALL THE FILE THROUGH THE SOCKET, OR WHAT DO YOU THINK IF I TAKE THE DATA I HAVE CAPTURE AND I SEND THAT STREAM THROUGH THE SOCKET , THEN IN THE OTHER SIDE, IN THE CLIENT I TAKE THAT STREAM AND I WRITE THE .WAV FILE,
COULD YOU HELP ME TO DO THAT.
ITS REALLY URGENT TO ME TO DO THAT CAUSE I NEED TO IMPLEMENT THAT IN ONE PROJECT IM DOING TO FINISH THIS SEMESTER IN THE UNIVERSITY, SO PLEASE MY BROTHER TRY TO HELP ME,
GOD BLESS YA
REUBEN GUTIERREZ
MY EMAIL ADDRESS IS
rubencia@yahoo.com
thanx again
REU
|
|
|
|
 |
|
 |
hi,
can u temme how to go abt saving tht .wav file n sending it to a server in vc++.since i'm in a hurry to finish my prjkt can u gimme the code r suggest an URL where i can find some code for help.
Nilegna
|
|
|
|
 |
|
 |
1) After recording, you have a buffer who holds all the data.
So you can write all data to file. ( you can using fopen, fwrite, fclose )
2) During recording, the callback function is called many time when buffer is full.
So each time the callback function is called you can use write all data to file.
3) If you want to send data to server, you can use winsock in win32.
you can use send(..) to send buffer to server.
|
|
|
|
 |
|
 |
After reading this program , i also want to save n wave file
but i don't know which buffer will hold all the data
can you tell me which one
i thought maybe the follow one
(1)lpSaveBuffer
(2)lpBuffer1
(3)others
which one hold hold the data
and if i want to save wav file
which information i should send to file and the let the file could be played?
|
|
|
|
 |
|
 |
I have tried to port it to PocketPC
Basically I modified the config.cpp and .h file and compiled it successfully in EVC++ 4.0
But when I try to use it, then I got lots of link error
What I did is to simple include the head file in a simpel GUI like
#include "config.h"
Then use the DoPlay and other methods in a button click event handling methods, but then I received lots of link error:
Linking...
config.obj : error LNK2005: "unsigned long dwRepetitions" (?dwRepetitions@@3KA) already defined in echo_ppcDlg.obj
config.obj : error LNK2005: "struct HWAVEIN__ * hWaveIn" (?hWaveIn@@3PAUHWAVEIN__@@A) already defined in echo_ppcDlg.obj
config.obj : error LNK2005: "struct HWAVEOUT__ * hWaveOut" (?hWaveOut@@3PAUHWAVEOUT__@@A) already defined in echo_ppcDlg.obj
config.obj : error LNK2005: "struct tWAVEFORMATEX waveform" (?waveform@@3UtWAVEFORMATEX@@A) already defined in echo_ppcDlg.obj
config.obj : error LNK2005: "struct wavehdr_tag * pWaveHdr1" (?pWaveHdr1@@3PAUwavehdr_tag@@A) already defined in echo_ppcDlg.obj
config.obj : error LNK2005: "struct wavehdr_tag * pWaveHdr2" (?pWaveHdr2@@3PAUwavehdr_tag@@A) already defined in echo_ppcDlg.obj
config.obj : error LNK2005: "unsigned long dwDataLength" (?dwDataLength@@3KA) already defined in echo_ppcDlg.obj
config.obj : error LNK2005: "char * block" (?block@@3PADA) already defined in echo_ppcDlg.obj
config.obj : error LNK2005: "unsigned long blockSize" (?blockSize@@3KA) already defined in echo_ppcDlg.obj
ARMV4Dbg/echo_ppc.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
Have no idea how to solve them. Maybe it is because the config is not a class?
/B.c.
|
|
|
|
 |
|
 |
Hi,
Actually I am an expert in wince rather than in win32,
so i hope i can help you.Actually to port to wince.I think you can make a new MFC application,after that you add into your projet the config.h and config.cpp.After don't forget include config.h in yourdialog.c,then
you make some button in the Dialog,and you call DoPlay,DoRecord,DoRecord_end
for 3 buttons example.
But don't forget to change the string to TEXT('etc') in the MessageBox.
Example:
MessageBox(NULL,"error with lpNewBuffer",NULL,MB_OK);
change to
MessageBox(NULL,TEXT(error with lpNewBuffer),NULL,MB_OK);
If you have another problem in wince.Tell me i will try to support to you.
If you can make it run in wince,tell me also.
Best regards,
JT
|
|
|
|
 |
|
 |
Thanks, it is working now by changing the link option.
I have sent the ported code to your yahoo email account, one problem with this code is the recording does not take longer than 5 seconds, and not working steadily either, especially on the actual device, the end recording will just crash but in the emulator, seems better however, still not recording long.
Thanks
|
|
|
|
 |
|
 |
Hi,
I had the same Link Error as you did before.You mentioned that you fixed it with changing the link option.I still can't figure it out.Could you please tell me which option i should change?
Cheers!
|
|
|
|
 |
|
 |
I am working on the voice recording in Pocket PC now. I got the same error when I tried to include the config.h file. Could you please tell me how you solve the problem by changing link option? I know it has been a long time since you posted this message. If possible, please give me some suggestion. I really appreciate your help. Thank you very much.
|
|
|
|
 |