0
0

[code:1poai9ax]/*

Record.cpp :

Simple application to record analogue sound data, encode it to pulse code modulation
(a digital format) and persist the encoded data to a WAVE file on the local disk.

*/

include "fmod.h"

include <iostream>

include <limits>

define RECORDRATE 44100

define RECORDLEN (RECORDRATE)*120; //maximum of 2 minutes of recording

using namespace std;

void enterWait();

FSOUND_SAMPLE* record();

FSOUND_SAMPLE* record()
{
//declare sample definition– let FMOD know you want it in stereo and in 16-bits

//the latter four parameters are recording frequency, volume, pan and priority.

FSOUND_SAMPLE* sample = FSOUND_Sample_Alloc(FSOUND_UNMANAGED, RECORDLEN, FSOUND_STEREO | FSOUND_STEREO, RECORDRATE, 255, 128, 255);

FSOUND_Record_StartSample(sample, true); //start recording

cout &lt;&lt; &quot;Recording has started. Please any button on the keyboard to stop recording.&quot;; 

enterWait();

FSOUND_Record_Stop();

return sample;

}

void enterWait()
{
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), ‘\n’);
}

int main(int argc, char* argv[])
{
return 0;
}
[/code:1poai9ax]

here’s how visual c++ 6.0 responds to compiling the app

[code:1poai9ax]
——————–Configuration: record – Win32 Debug——————–
Compiling...
record.cpp
c:\3rd year project\code\record\record.cpp(29) : error C2143: syntax error : missing ‘)’ before ‘;’
c:\3rd year project\code\record\record.cpp(29) : error C2660: ‘FSOUND_Sample_Alloc’ : function does not take 2 parameters
c:\3rd year project\code\record\record.cpp(29) : error C2143: syntax error : missing ‘;’ before ‘,’
c:\3rd year project\code\record\record.cpp(29) : error C2059: syntax error : ‘)’
Error executing cl.exe.

record.obj – 4 error(s), 0 warning(s)
[/code:1poai9ax]

i have linked fmodvc.lib.

i have no idea why this is happening, i’ve made a fully working fmod program using FSOUND_Sample_Alloc before using Visual C++.

any ideas?

  • You must to post comments
0
0

[quote:3itcp2d6]

define RECORDLEN (RECORDRATE)*120; //maximum of 2 minutes of recording

[/quote:3itcp2d6]

Remove the ‘;’ char.

  • You must to post comments
0
0

[quote="KarLKoX":1h9v4n7j][quote:1h9v4n7j]

define RECORDLEN (RECORDRATE)*120; //maximum of 2 minutes of recording

[/quote:1h9v4n7j]

Remove the ‘;’ char.[/quote:1h9v4n7j]

wow, i can’t believe thats all it was!

in any case i fixed it by making the call to the sample allocation function with the hardcoded value 44100*120.

thanks for your help!

also: to whoever it concerns, can you please remove the insulting comment placed beneath my name. i think i’ve got 12 or 13 posts, spread over a substantial period of time.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.