 |
|
 |
I tried to merge two wave files with different sample rates/bps but that didn't work; I wasn't able to play them in Windows Media Player. Do you perhaps know a way to resample wave files easily in .NET?
Thanks.
|
|
|
|
 |
|
 |
i have used u's code and wave files.i find that u's wave files format is CCITT µ Law.i use PCM format wave,but i can't get correct merged wave.Also,i find there's onething different between yours and mine.Yours MPC rate is 8KHz,mine is 22KHz.What's wrong with it?
thanks a lot!
|
|
|
|
 |
|
 |
hi
i want to play two sound file same time and want to listen the sound of these file
on separtly on left and right speaker,means sound of one file should play on left
speaker and second file should play on right speaker
thank u in advance
malik
malik
|
|
|
|
 |
|
 |
Hi;
I am realy very new on speach analyzing. I recorded my voice to a waw file but i cant read it. please help me. If you have some sample codes or documents about how could I read a waw file would you please send it to my e-mail(oncusen@hotmail.com). If you help me I will be very glad. I find no way out. Thanks in advance
Best regards
öncü
|
|
|
|
 |
|
 |
Just google on wav file format, after you know how file bytes are arranged, just open the file with openFile function and start reading (1-n)byte by (1-n)bytes
http://www.borg.com/~jglatt/tech/wave.htm
|
|
|
|
 |
|
 |
I would like to assemble a master .WAV from various smaller .WAV's.
I hand-made an 18 note instrument, and have captured each note to a .WAV file. I would like to compile a .WAV file of these notes from a simple MIDI file - I'll pull note and timecode from the MIDI file (already have this) and render a master .WAV from my individual .WAV's.
This part is a little over my head. Can you suggest a way to do this?
Thanks!
|
|
|
|
 |
|
 |
Can anyone suggest help with the neccessary changes required to compile the code in MS embedded Visual C 4.0? For example, in wave.cpp the line
string errorMsg((LPTSTR) lpMsgBuf);
creates compiler error C2664 converting parameter from 'type1' to 'type2'
Cannot convert from 'unsigned short *' to 'const class std::allocator'
No constructor could take the source type, or constructor overload resolution was ambiguous
Different versions of string.h on my pc versus a Visual C installation?
Thanks.
|
|
|
|
 |
|
 |
Hi,
I've been using the code from this tutorial to concatenate wave files, but the quality of the output is not the greatest at the bounderies. I was wondering if anyone knew a way of equalising the amplitude at the bounderies of the concatenated files?
THanks
|
|
|
|
 |
|
 |
Hi,
I'll start by saying this is a great article.
I was wondering if there was a way of playing the concatenated Wave file without saving it to disk. I am trying to make an application that concatenates the files and plays them, it does not need to save them on secondary storage. At the moment I am saying the file to disk and using the PlaySound method to play the file.
Any help will be much appriciated.
Thanks
Yash
|
|
|
|
 |
|
 |
Hi, thanks for your comments.
There are many examples over the internet about playing waves from memory,one of them : http://www.codeproject.com/audio/wave_class_for_playing_and_recording.asp
|
|
|
|
 |
|
 |
HI,
Thank you very much for your response, I've looked at a couple of the articles and have used it to modify the + operator of the SoundClip class so that it plays the concatenate wave, the class compiles but does not play the sound, I am using the waveOutWrite method to play the sound but I am getting an Invalid Parameter passed to system function error. I was wondering if you could possibly help me resolve the issue, I've been cracking at it for a couple of days now without any luck, below is the modified code.
SoundClip SoundClip::operator+ (const SoundClip &w) const{
if (fmt.wFormatTag!=w.fmt.wFormatTag)
throw "Can't concatenate waves with different format tags";
SoundClip ret_val;
ret_val.fmt = w.fmt;
ret_val.riff = w.riff;
ret_val.data = w.data;
ret_val.data.dataSIZE= data.dataSIZE+w.data.dataSIZE;
ret_val.extraParamLength = w.extraParamLength;
ret_val.extraParam = w.extraParam;
ret_val.wave = new BYTE[ret_val.data.dataSIZE];
memcpy(ret_val.wave,wave,data.dataSIZE);
memcpy(ret_val.wave+data.dataSIZE,w.wave,w.data.dataSIZE);
string folder = getFileFolder(fileName);
string title1 = getFileTitle(fileName);
string title2 = getFileTitle(w.fileName);
ret_val.fileName = folder;
ret_val.fileName.append("temp.wav");
//open wave device
HWAVEOUT hWaveOut; /* device handle */
WAVEFORMATEX wfx;
MMRESULT result; /* for waveOut return values */
/*
* WAVEFORMATEX structure.
* the structure describes the format of the audio.
*/
wfx.nSamplesPerSec = 44100; /* sample rate */
wfx.wBitsPerSample = 16; /* sample size */
wfx.nChannels = 2; /* channels */
wfx.cbSize = 0; /* size of _extra_ info */
wfx.wFormatTag = WAVE_FORMAT_PCM;
wfx.nBlockAlign = (wfx.wBitsPerSample >> 3) * wfx.nChannels;
wfx.nAvgBytesPerSec = wfx.nBlockAlign * wfx.nSamplesPerSec;
/*
* try to open the default wave device. WAVE_MAPPER is
* a constant defined in mmsystem.h, it always points to the
* default wave device on the system
*/
if(waveOutOpen(
&hWaveOut,
WAVE_MAPPER,
&wfx,
0,
0,
CALLBACK_NULL
) != MMSYSERR_NOERROR) {
cout << "unable to open WAVE_MAPPER device" << endl;
ExitProcess(1);
}
void* block = NULL; //pointer to assemble wave file for playback
block = ret_val.riff.riffID + ret_val.riff.riffSIZE + 'W' + 'A' + 'V' + 'E'
+ 'f' + 'm' + 't' + ' ' + ret_val.fmt.fmtSIZE + ret_val.fmt.wFormatTag
+ ret_val.fmt.nChannels + ret_val.fmt.nSamplesPerSec
+ ret_val.fmt.nAvgBytesPerSec + ret_val.fmt.nBlockAlign + ret_val.fmt.wBitsPerSample
+ 'd' + 'a' + 't' + 'a' + ret_val.data.dataSIZE + *ret_val.wave + NULL ;
LPSTR wave_LPSTR = (LPSTR)block;
WAVEHDR header;
header.dwBufferLength = sizeof(wave_LPSTR);
header.lpData = wave_LPSTR;
MMRESULT openDeviceResult = waveOutPrepareHeader(hWaveOut, &header, sizeof(WAVEHDR));
cout << "Open Device Result " << openDeviceResult << endl;
MMRESULT playResult = waveOutWrite(hWaveOut, &header, sizeof(WAVEHDR));
cout << "Play Result " << playResult << endl;
//PlaySound(ret_val, NULL, SND_RESOURCE|SND_SYNC);
char errorText[256];
waveOutGetErrorText(playResult, errorText, sizeof(errorText));
cout << errorText << endl;
return ret_val;
}
Thanks a lot for your help
|
|
|
|
 |
|
 |
block = ret_val.riff.riffID + ret_val.riff.riffSIZE + 'W' + 'A' + 'V' + 'E'
+ 'f' + 'm' + 't' + ' ' + ret_val.fmt.fmtSIZE + ret_val.fmt.wFormatTag
+ ret_val.fmt.nChannels + ret_val.fmt.nSamplesPerSec
+ ret_val.fmt.nAvgBytesPerSec + ret_val.fmt.nBlockAlign + ret_val.fmt.wBitsPerSample
+ 'd' + 'a' + 't' + 'a' + ret_val.data.dataSIZE + *ret_val.wave + NULL ; ?????????????
I suggest you to read what the pointer is and how you should work with
memory.
|
|
|
|
 |
|
 |
none og the enquierys have been answered
|
|
|
|
 |
|
 |
its totaly f***ed a compleat waste of time if you ask me
|
|
|
|
 |
|
|
 |
|
 |
Hi folks,
nice class, but it doesn't seem to work when using Microsoft's default audio recorder "sndrec32".
As CWave is perfect for my application, I have modified it slightly in order to get it working with self-recorded audio files using the program mentioned above.
As far as I have experienced the problem only applies to sndrec32.
Problem:
dataSIZE is not determined correctly if fmt.wFormatTag equals 1
Whether or not there are any extraParams present in the RIFF file seems to be independent of the format tag.
Solution:
Snoop ahead and check whether there are any extraParms before the fact-Tag.
Coding:
Wave.h:
insert a helper variable to the private section of the class definition:
Line 65: DWORD snoop;
Wave.cpp
Insert code:
Line 35:
ReadFile(hF,(LPVOID)&snoop,4,&read,NULL); // snoop four bytes ahead
SetFilePointer(hF,-4,NULL,FILE_CURRENT); // and reset file pointer
Exchange if-condition:
Line 35:
// if (fmt.wFormatTag!=1){
if ((snoop >> 16) == 0x6166){ // are we going to find something like "??fa" (string) when we read ?
Exchange if-condition:
Line 129 (CWave::saveToFile()):
// if (fmt.wFormatTag>1){
if (snoop != 0x74636166){ //write extraParams UNLESS we found "fact" earlier
Line numbers apply to unmodified files... .
Have fun!
Bernie
|
|
|
|
 |
|
 |
same thing applies to MS SAPI 5.1 wav output. But, I had to change 0x6166 to 0x6164 (??data instead of ??fact). Actually the line 35 is modified like this:
if ( ((snoop >> 16) == 0x6166) || ((snoop >> 16) == 0x6164) ){ // are we going to find something like "??fa" or "??da" (string) when we read ?
Hope I did the right thing..
thanks for the fix anyway.
|
|
|
|
 |
|
 |
its a very good article, and how about concatenating mp3 files ?
|
|
|
|
 |
|
 |
I have been looking for a way to do WAV mixing (not concatenating, but mixing so that each sound from the separate WAV files plays simultaneously). Information on how to do this seems elusive.
I've been working with DirectX (specifically, DirectMusic and DirectSound) in my application. DirectX is able to mix sounds before it passes the audio to the sound card.. Is there perhaps a way to simply have it re-direct the audio to a WAV file on the hard drive instead?
Eric
|
|
|
|
 |
|
 |
i was waiting for this thx a lot
i need help on voice synthesizer other tahn english.i am developing a TTS for kannada language(kind of Indian language)and of 'phonetic type'
if u have more info kindly mail me
uttam_hin@yahoo.com
uttam
|
|
|
|
 |
|
 |
Great Article!
Do you know how to Concatenating AVI Files?
If you have some code, this would be great,thanx!
|
|
|
|
 |
|
 |
I guess it would be very alike the method described in the article. AVI is RIFF too.
Maybe you should check www.wotsit.org, they have very much info on a lot of file types.
|
|
|
|
 |
|
 |
I'd like a function to convert one wave type to another. Or some hint on how to do it.
|
|
|
|
 |
|
 |
Great Article!
Do you know how to Concatenating MPG Files?
If you have some code, this would be great
Thanks
|
|
|
|
 |
|
 |
mpeg files can easily be concatenated using the dos-copy-command.
for example:
copy /b movie1.mpg+movie2.mpg fullmovie.mpg
greetings
|
|
|
|
 |