Complete review of audio system
Still some work left...
This commit is contained in:
parent
a61b832c4a
commit
02c456432d
6 changed files with 483 additions and 804 deletions
|
@ -24,7 +24,9 @@ int main()
|
|||
|
||||
InitAudioDevice(); // Initialize audio device
|
||||
|
||||
PlayMusicStream(0, "resources/audio/guitar_noodling.ogg"); // Play music stream
|
||||
Music music = LoadMusicStream("resources/audio/guitar_noodling.ogg");
|
||||
|
||||
PlayMusicStream(music);
|
||||
|
||||
int framesCounter = 0;
|
||||
float timePlayed = 0.0f;
|
||||
|
@ -58,12 +60,12 @@ int main()
|
|||
SetMusicVolume(volume);
|
||||
}
|
||||
*/
|
||||
if (IsWindowMinimized()) PauseMusicStream(0);
|
||||
else ResumeMusicStream(0);
|
||||
if (IsWindowMinimized()) PauseMusicStream(music);
|
||||
else ResumeMusicStream(music);
|
||||
|
||||
timePlayed = GetMusicTimePlayed(0)/GetMusicTimeLength(0)*100*4; // We scale by 4 to fit 400 pixels
|
||||
|
||||
UpdateMusicStream(0); // Update music buffer with new stream data
|
||||
timePlayed = GetMusicTimePlayed(music)/GetMusicTimeLength(music)*100*4; // We scale by 4 to fit 400 pixels
|
||||
|
||||
UpdateMusicStream(music); // Update music buffer with new stream data
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
|
@ -83,9 +85,11 @@ int main()
|
|||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)
|
||||
UnloadMusicStream(music); // Unload music stream buffers from RAM
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue