Author Topic: _SNDPLAYCOPY  (Read 49 times)

warren

  • QB64 IS AMAZING
_SNDPLAYCOPY
« on: May 15, 2018, 12:32:58 PM »
Playing small wav works fine until a Beep or Sound is executed and then the volume of the wav play is drastically reduced. Anyone know what's wrong. Win7 sys and nothing is found wrong.   

FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: _SNDPLAYCOPY
« Reply #1 on: May 15, 2018, 01:43:02 PM »
In my experience, playing a new sound on the same channel of a previously playing sound will reduce the level of the first momentarily then after the new sound is played the volume of the first will come back to the normal value. Is that the case?

warren

  • QB64 IS AMAZING
Re: _SNDPLAYCOPY
« Reply #2 on: May 15, 2018, 02:26:11 PM »
little more info:QB64 1.2, WIN7

Handle& = _SNDOPEN(PATH$ + "CLICK.WAV")
IF Handle& = 0 THEN  END

1:
_SNDPLAYCOPY Handle&, 1   
BEEP
SOUND 0,1
_DELAY 1
GOTO 1

After first wav play (64 ms long), vol = ~10% when a Beep or Sound cmd is operated. volume of wav remains low. Handle&=1.

thanks. warren.


FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: _SNDPLAYCOPY
« Reply #3 on: May 15, 2018, 02:41:59 PM »
That's expected behavior. All short sounds you're playing at a very short interval are all output through the same channel, which has the side effect you experience of a previous sound being lowered in level so that the new sound gets played.

warren

  • QB64 IS AMAZING
Re: _SNDPLAYCOPY
« Reply #4 on: May 15, 2018, 03:10:06 PM »
Fellippe you are right!  after trying a little longer wav file the volume was much higher(still reduced some). Is this effect a condition of QB64 or my computer?  Beep and Sound cmds don't interfere with each other only sndplayer. Any idea about how to work around the feature? ... warren

FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: _SNDPLAYCOPY
« Reply #5 on: May 15, 2018, 03:26:26 PM »
QB64 uses an external library (https://www.openal.org/) to handle sound and as such we just pass the play command to it, to put it simply. Because of that I assume it's standard behavior.