aboutsummaryrefslogtreecommitdiffstats
path: root/examples/alrecord.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/alrecord.c')
-rw-r--r--examples/alrecord.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/alrecord.c b/examples/alrecord.c
index 0835b468..c21ba30b 100644
--- a/examples/alrecord.c
+++ b/examples/alrecord.c
@@ -63,13 +63,13 @@ typedef struct Recorder {
FILE *mFile;
long mDataSizeOffset;
- size_t mDataSize;
+ ALuint mDataSize;
float mRecTime;
int mChannels;
int mBits;
int mSampleRate;
- size_t mFrameSize;
+ ALuint mFrameSize;
ALbyte *mBuffer;
ALsizei mBufferSize;
} Recorder;
@@ -184,7 +184,7 @@ int main(int argc, char **argv)
return 1;
}
- recorder.mRecTime = strtod(argv[1], &end);
+ recorder.mRecTime = strtof(argv[1], &end);
if(!(recorder.mRecTime >= 1.0f && recorder.mRecTime <= 10.0f) || (end && *end != '\0'))
{
fprintf(stderr, "Invalid record time: %s\n", argv[1]);
@@ -314,7 +314,7 @@ int main(int argc, char **argv)
(err=alcGetError(recorder.mDevice)) == ALC_NO_ERROR && !ferror(recorder.mFile))
{
ALCint count = 0;
- fprintf(stderr, "\rCaptured "SZFMT" samples", recorder.mDataSize);
+ fprintf(stderr, "\rCaptured %u samples", recorder.mDataSize);
alcGetIntegerv(recorder.mDevice, ALC_CAPTURE_SAMPLES, 1, &count);
if(count < 1)
{
@@ -357,10 +357,11 @@ int main(int argc, char **argv)
}
}
#endif
- recorder.mDataSize += fwrite(recorder.mBuffer, recorder.mFrameSize, count, recorder.mFile);
+ recorder.mDataSize += (ALuint)fwrite(recorder.mBuffer, recorder.mFrameSize, count,
+ recorder.mFile);
}
alcCaptureStop(recorder.mDevice);
- fprintf(stderr, "\rCaptured "SZFMT" samples\n", recorder.mDataSize);
+ fprintf(stderr, "\rCaptured %u samples\n", recorder.mDataSize);
if(err != ALC_NO_ERROR)
fprintf(stderr, "Got device error 0x%04x: %s\n", err, alcGetString(recorder.mDevice, err));