0
0

Hi everyone,
I am creating a DLL that utilizes FMOD’s audio playing and recording functions for a friend.
He is having problems hearing the complete raw audio file when the DLL has finished recording it. I used FSOUND_Record_StartSample(Sample, 0); for that; when it has finished, it writes to a raw audio file fwrite(Ptr1, Length1, 1, File);.
I have initialized FMOD like this:
FSOUND_Init(SoundQuality , 16, 0);
where SoundQuality is the variable that holds the output rate.
My Play function looks like this:
[code:136e7hkl]
FSOUND_STREAM* LocalStream; // Global stream handle – there’s only one stream.
int BitsPerSample = 16; // Can be either 8 or 16.
__declspec(dllexport) void __stdcall Play(char* Filename) {
if (BitsPerSample == 16)
LocalStream = FSOUND_Stream_Open(Filename, FSOUND_LOADRAW|FSOUND_MONO|FSOUND_SIGNED|FSOUND_16BITS, 0, 0);
if (BitsPerSample == 8)
LocalStream = FSOUND_Stream_Open(Filename, FSOUND_LOADRAW|FSOUND_MONO|FSOUND_UNSIGNED|FSOUND_8BITS, 0, 0);
_beginthread(PlayThread, 0, NULL);
return;
}
void PlayThread(void* Pointer) {
int Channel;
Channel = FSOUND_Stream_Play(FSOUND_FREE, LocalStream);
FSOUND_SetFrequency(Channel, SoundQuality);
while (FSOUND_IsPlaying(Channel)) Sleep(50);
}
[/code:136e7hkl]
I have no idea why he cannot hear the whole file. Am I doing something wrong in the Play(char* Filename) function or is it a problem on his end with sound device drivers?
Thanks in advance for any replies.
Yours sincerely,
Peter.
http://tdlsoftware.org

  • You must to post comments
0
0

One of the reasons I put it in a thread was that my friend uses AutoIt (http://autoitscript.com) to write his applications in – and that language does not support threads as far as I know.
I have checked the output with GoldWave; it has no problems opening it either. Neither should the FSOUND_Stream_Open function, since I have tested it with that, too, in a separate program.
(Thanks for putting my code in code tags, Brett..)

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.