Checking issue with sound volume
It seems individual sound volume level is not set...
This commit is contained in:
parent
aa00d77110
commit
c001bdb2de
1 changed files with 8 additions and 8 deletions
16
src/raudio.c
16
src/raudio.c
|
@ -457,7 +457,7 @@ static void MixAudioFrames(float *framesOut, const float *framesIn, ma_uint32 fr
|
||||||
float *frameOut = framesOut + (iFrame*device.playback.channels);
|
float *frameOut = framesOut + (iFrame*device.playback.channels);
|
||||||
const float *frameIn = framesIn + (iFrame*device.playback.channels);
|
const float *frameIn = framesIn + (iFrame*device.playback.channels);
|
||||||
|
|
||||||
frameOut[iChannel] += frameIn[iChannel]*masterVolume*localVolume;
|
frameOut[iChannel] += (frameIn[iChannel]*masterVolume*localVolume);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -595,11 +595,11 @@ AudioBuffer *CreateAudioBuffer(ma_format format, ma_uint32 channels, ma_uint32 s
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
audioBuffer->volume = 1;
|
audioBuffer->volume = 1.0f;
|
||||||
audioBuffer->pitch = 1;
|
audioBuffer->pitch = 1.0f;
|
||||||
audioBuffer->playing = 0;
|
audioBuffer->playing = false;
|
||||||
audioBuffer->paused = 0;
|
audioBuffer->paused = false;
|
||||||
audioBuffer->looping = 0;
|
audioBuffer->looping = false;
|
||||||
audioBuffer->usage = usage;
|
audioBuffer->usage = usage;
|
||||||
audioBuffer->bufferSizeInFrames = bufferSizeInFrames;
|
audioBuffer->bufferSizeInFrames = bufferSizeInFrames;
|
||||||
audioBuffer->frameCursorPos = 0;
|
audioBuffer->frameCursorPos = 0;
|
||||||
|
@ -702,7 +702,7 @@ void SetAudioBufferVolume(AudioBuffer *audioBuffer, float volume)
|
||||||
{
|
{
|
||||||
if (audioBuffer == NULL)
|
if (audioBuffer == NULL)
|
||||||
{
|
{
|
||||||
TraceLog(LOG_ERROR, "SetAudioBufferVolume() : No audio buffer");
|
TraceLog(LOG_WARNING, "SetAudioBufferVolume() : No audio buffer");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -714,7 +714,7 @@ void SetAudioBufferPitch(AudioBuffer *audioBuffer, float pitch)
|
||||||
{
|
{
|
||||||
if (audioBuffer == NULL)
|
if (audioBuffer == NULL)
|
||||||
{
|
{
|
||||||
TraceLog(LOG_ERROR, "SetAudioBufferPitch() : No audio buffer");
|
TraceLog(LOG_WARNING, "SetAudioBufferPitch() : No audio buffer");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue