Explorar el Código

Update audio_raw_stream.c to more closely follow raylib coding conventions

I accidentally put the file in the wrong folder.
pull/5637/head
dan-hoang hace 4 días
cometido por GitHub
padre
commit
4876d703f5
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: B5690EEEBB952194
Se han modificado 1 ficheros con 6 adiciones y 13 borrados
  1. +6
    -13
      examples/audio/audio_raw_stream.c

+ 6
- 13
examples/audio/audio_raw_stream.c Ver fichero

@ -62,35 +62,27 @@ int main(void)
if (IsKeyDown(KEY_UP))
{
newSineFrequency += 10;
if (newSineFrequency > 12500)
newSineFrequency = 12500;
if (newSineFrequency > 12500) newSineFrequency = 12500;
}
if (IsKeyDown(KEY_DOWN))
{
newSineFrequency -= 10;
if (newSineFrequency < 20)
newSineFrequency = 20;
if (newSineFrequency < 20) newSineFrequency = 20;
}
if (IsKeyDown(KEY_LEFT))
{
pan -= 0.01f;
if (pan < -1.0f) pan = -1.0f;
SetAudioStreamPan(stream, pan);
if (pan < -1.0f)
pan = -1.0f;
}
if (IsKeyDown(KEY_RIGHT))
{
pan += 0.01f;
if (pan > 1.0f) pan = 1.0f;
SetAudioStreamPan(stream, pan);
if (pan > 1.0f)
pan = 1.0f;
}
if (IsAudioStreamProcessed(stream))
@ -129,7 +121,8 @@ int main(void)
int wavelength = SAMPLE_RATE/sineFrequency;
// Draw a sine wave with the same frequency as the one being sent to the audio stream
for (int i = 0; i < screenWidth; i++) {
for (int i = 0; i < screenWidth; i++)
{
int t0 = windowStart + i*windowSize/screenWidth;
int t1 = windowStart + (i + 1)*windowSize/screenWidth;
Vector2 startPos = { i, 250 + 50*sin(2*PI*t0/wavelength) };

Cargando…
Cancelar
Guardar