22 May '13 - 15:41 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Problem with short sound.  (Read 527 times)
GrimRP
Guest
« on: 20 Jul '12 - 12:06 »
Reply with quoteQuote

Hello,

I have used bass for an old project and this has always been a problem (tried the latest version, no difference), regardless of format.

When playing this particular audio file in my game it has some odd scratchy/beepy noise every time the file is played.

This does not present itself in WMP or VLC or any other audio playing software I have.

The file is a .ogg currently and is shown as being 00:00:00 long (it is a very short reel sound for a poker machine, it is played 5x quite quickly as the reels spin/stop).

Any ideas?
Logged
Ian @ un4seen
Administrator
Posts: 15259


« Reply #1 on: 20 Jul '12 - 16:34 »
Reply with quoteQuote

Please upload the troublesome OGG file to have a look at here...

   ftp.un4seen.com/incoming/

Also, have you reproduced the problem on multiple system, or is it a system-specific problem? If the latter, what Windows version is that running?
Logged
GrimRP
Guest
« Reply #2 on: 20 Jul '12 - 23:42 »
Reply with quoteQuote

Hello,

I tried to uploaded it, not sure if it actually worked, 'reelstop.ogg'.

Also this is the code used to actually play the various sounds:

Procedure PlaySnd(Const Sound: SmallInt);
var
 sHandle  : Cardinal;
 sData    : Pointer;
 sSnd     : HSTREAM;
 sFile    : String;
 sSize    : Integer;
 IsActive : Byte;
Begin
 case Sound Of // case statement for selection etc...
  0: sFile := 'reelstop';
  1: sFile := 'scatter1';
  2: sFile := 'scatter2';
  3: sFile := 'scatter3';
  4: sFile := 'scatter4';
  5: sFile := 'scatter5';
  6: sFile := 'featureinit';
 end;

 sHandle := FindResource(hInstance, pChar(sFile), RT_RCDATA);
 sData := LockResource(LoadResource(hInstance, sHandle));
 sSize := SizeOfResource(hInstance, sHandle);
 sSnd := BASS_StreamCreateFile(True, sData, 0, sSize, BASS_STREAM_AUTOFREE OR BASS_UNICODE);

 BASS_ChannelPlay(sSnd, False);

 if (Sound = 6) then
 begin
  // Do not continue until sound has finished playing.
  IsActive := BASS_ChannelIsActive(sSnd);
   while (IsActive <> 0) do
   begin
    IsActive := BASS_ChannelIsActive(sSnd);
   end;
 end;
End;

reelstop being the only one that produces the strange buzzing/beeping noise (it is difficult to explain).

I use Windows 7 64-Bit, so does my laptop which also produces this problem.
Logged
GrimRP
Guest
« Reply #3 on: 21 Jul '12 - 12:29 »
Reply with quoteQuote

Hi,

I know what is causing the problem.

I am using Application.ProcessMessages; in the for loop for the spins so that I am still able to access some
debugging controls and stop some graphic anomalies. I just commented the line out and the strange sound
during the spins has gone.

Is there much I can do about this?
Logged
GrimRP
Guest
« Reply #4 on: 21 Jul '12 - 12:32 »
Reply with quoteQuote

Hi,

I know what is causing the problem.

I am using Application.ProcessMessages; in the for loop for the spins so that I am still able to access some
debugging controls and stop some graphic anomalies. I just commented the line out and the strange sound
during the spins has gone.

Is there much I can do about this?

Sorry forget that, it was because I had the sound down to a level you don't noticed it. It still happens with or without that line.
Logged
Ian @ un4seen
Administrator
Posts: 15259


« Reply #5 on: 23 Jul '12 - 16:53 »
Reply with quoteQuote

I tried to uploaded it, not sure if it actually worked, 'reelstop.ogg'.

Got it, thanks. The file itself contains some background noise at around 2KHz; is that the noise you're referring to? As it's part of the file, that noise should be present with all players, but if you don't hear it with some players, perhaps you have enabled EQ to reduce the level at 2KHz?
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines