-
Hi, Anonytmouse, thank you very much for your reply, appreciate.
Thanks for your explanation. Do you mean by using Speex, we could not have all the wave files saved in Temp, only can save one wave file? Correct me if I am wrong. It is OK if really cant.
May I ask? Can I do the same thing for decoding part?
-
Why would you want to save all the temporary wave files? The idea is that they're only temporary and that the actual sound files are transferred in the .spx format on the floppy disk. Of course, you can do anything, but saving all the wave files with different file names means that we have to come up with some complicated scheme to delete them when they are no longer needed.
>> Can I do the same thing for decoding part? <<
What do you mean? For the decoding part, you take all the .spx files are decompress them back to wave files with the speexdec program.
-
Hi, Anonytmouse, thank you for your reply.
I am sorry, I didnt mean to cause the confuse here, forgive my poor English, I am trying my best to learn it gradually, please dont angry. I am sorry.
OK, I am just asking, Since it cant save the wave files, ther willnot be a problem for children to bring the floppy disk to centre.
As I said in the previous post, the error message box came out, what should I do so that the error message wont come out?
Regarding the decoding part, Can I elaborate a little bit? Originally, the "Play wave" button was designed to function like this: When the child bring the floppy disk back to centre, the therapist will click button "play wave". This button will prompt twice for each click. First prompt is to open wave recorded by therapist's own voice and the second prompt is to open wave recorded by children at home. That's why I am asking Is it possible to implement codes so that the MP3 file can be converted to Wave file when button "Play wave' is clicked?
Thank you for your patience to read my poor English:(
-
>> As I said in the previous post, the error message box came out, what should I do so that the error message wont come out? <<
Comment out the MessageBox line (Put the two "//" back in front of it).
I've got to log off now, but I can help you with the decoding part tomorrow. It is possible to make the software work as it did before.
-
Hi, Anonytmouse, thank you very much for your reply.
OK, have a nice day. Thank you
-
The simplest and most expensive way is to get Sony Sound Forge Studio edition (lite edition) and convert the MP3's to WAV's and vice versa.
Another way to do this is to fire up DirectShow, play the MP3's and read the DSP or query the driver to read the DSP and return the actual values being sent to it. This is what a WAV file is, the pure raw data - most are not compressed at all.
-
This thread has been resolved via PMs. If anyone is interested, the decode function, which is almost identical to the encode function is reproduced below.
Code:
BOOL SpeexDecode(LPCTSTR szInputFile, LPCTSTR szOutputFile)
{
STARTUPINFO si = { sizeof(STARTUPINFO) };
PROCESS_INFORMATION pi = { 0 };
TCHAR szCommandLine[MAX_PATH * 4 + 100];
TCHAR szPath[MAX_PATH];
TCHAR* p;
/* Get the path of the currently running executable
* which is where we expect speexdec to be located. */
GetModuleFileName(NULL, szPath, MAX_PATH);
p = FindLastOf(szPath, TEXT('\\')); p[0] = TEXT('\0');
/* Create command line. */
wsprintf(szCommandLine, TEXT("\"%s\\speexdec\" \"%s\" \"%s\""),
szPath, szInputFile, szOutputFile);
/* Execute command line. */
CreateProcess(NULL, szCommandLine, NULL,
NULL, FALSE, 0, NULL, NULL, &si, &pi);
/* Wait for the command to complete. */
WaitForSingleObject(pi.hProcess, INFINITE);
/* Uncomment this line for debugging, it will show the exact command line used. */
// MessageBox(NULL, szCommandLine, NULL, 0);
/* Cleanup. */
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
return 0;
}