0
0

Hi,

I’m new to fmod, and after unsuccessful searches in this forum, i have a question :

I have noises when using this kind of function :
[quote:k42zjno2]
FSOUND_Init(44100, 32, FSOUND_INIT_ACCURATEVULEVELS or FSOUND_INIT_GLOBALFOCUS);
FSOUND_SetDriver(0);
FSOUND_SetOutput( FSOUND_OUTPUT_DSOUND );
FSOUND_SetBufferSize(835);
FStream := FSOUND_Stream_Create( FullAudioCallBack, 835 * 2, FSOUND_NORMAL, 44100, 12345 );
If FStream = nil then
Raise Exception.Create(‘Allocation des flux impossible’);

 FFileStream := TFileStream.Create( myMPEG2File , fmOpenRead );
 FSOUND_Stream_Play( 0, FStream );

[/quote:k42zjno2]

Using the Callback method works nice, but i get noise and not ‘audible’ audio. Maybe i have to convert the mpeg quantum into WAV data ?

Here is the Fullaudio callback procedure :

[quote:k42zjno2]
function FullAudioCallBack(Stream: PFSoundStream; Buff: Pointer; Length, Param: Integer): ByteBool; cdecl;
var
Count: Integer;
Buffer: PChar;

begin
Buffer := PChar( Buff );
Count := 0;

Count := FFileStreaming.Read( Buffer^, Length );
Result := (Count <> 0);

end;
[/quote:k42zjno2]

Using this method with [b:k42zjno2]WAV file works nice[/b:k42zjno2], [b:k42zjno2]not with MPEG2[/b:k42zjno2]… ๐Ÿ˜ฅ

I’m using this Callback to play differents parts of one or several files seamlessly (my example don’t… at the moment ๐Ÿ˜‰ )

If someone knows where is the problem, i’ll be glad to know !! ๐Ÿ˜›

Thx,
Greg.

  • You must to post comments
0
0

OK…..

[url:2mololxb]http://www.fmod.org/forum/viewtopic.php?t=364&highlight=callback[/url:2mololxb]

This is the answer, and i do understand now. ๐Ÿ˜›

c u
Greg

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.