mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-06 14:23:12 +00:00
Update audio_music_stream.c
This commit is contained in:
parent
328d65b1b3
commit
9cbbf149d8
@ -44,6 +44,22 @@ int main(void)
|
|||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateMusicStream(music); // Update music buffer with new stream data
|
UpdateMusicStream(music); // Update music buffer with new stream data
|
||||||
|
|
||||||
|
// Restart music playing (stop and play)
|
||||||
|
if (IsKeyPressed(KEY_SPACE))
|
||||||
|
{
|
||||||
|
StopMusicStream(music);
|
||||||
|
PlayMusicStream(music);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pause/Resume music playing
|
||||||
|
if (IsKeyPressed(KEY_P))
|
||||||
|
{
|
||||||
|
pause = !pause;
|
||||||
|
|
||||||
|
if (pause) PauseMusicStream(music);
|
||||||
|
else ResumeMusicStream(music);
|
||||||
|
}
|
||||||
|
|
||||||
// Get normalized time played for current music stream
|
// Get normalized time played for current music stream
|
||||||
timePlayed = GetMusicTimePlayed(music)/GetMusicTimeLength(music);
|
timePlayed = GetMusicTimePlayed(music)/GetMusicTimeLength(music);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user