custom music (repost)

false

Member
Apr 23, 2024
9
0
130
How can i make a custom music mod everything helps. i heard it was easy plus we don't want to listen to mid sm64 Ost
 
How exactly do I make it so it loops the audio track at a certain point instead of just restarting at the beginning of the song? (in other words how do I make it loop properly?)
 
what about multiple songs? do i just do

local audio = audio_stream_load("audio file.ogg", "audio file 2.ogg")

function on_warp()
if gNetworkPlayers[0].currLevelNum == LEVEL_NAME then
stop_background_music(get_current_background_music())
audio_stream_set_looping(rand.randint(audio), true)
audio_stream_play(audio, true, 1)
else
audio_stream_play(audio, true, 0)
end
end

hook_event(HOOK_ON_WARP, on_warp)

or what
 
what about multiple songs? do i just do

local audio = audio_stream_load("audio file.ogg", "audio file 2.ogg")

function on_warp()
if gNetworkPlayers[0].currLevelNum == LEVEL_NAME then
stop_background_music(get_current_background_music())
audio_stream_set_looping(rand.randint(audio), true)
audio_stream_play(audio, true, 1)
else
audio_stream_play(audio, true, 0)
end
end

hook_event(HOOK_ON_WARP, on_warp)

or what
basically, but instead of using

("audio file.ogg", "audio file 2.ogg")

do

("audio file 2.ogg")

in a separate piece of code

example:
local audio = audio_stream_load("audio file.ogg")

function on_warp()
if gNetworkPlayers[0].currLevelNum == LEVEL_NAME then
stop_background_music(get_current_background_music())
audio_stream_set_looping(rand.randint(audio), true)
audio_stream_play(audio, true, 1)
else
audio_stream_play(audio, true, 0)
end
end

hook_event(HOOK_ON_WARP, on_warp)

local audio = audio_stream_load("audio file 2.ogg")

function on_warp()
if gNetworkPlayers[0].currLevelNum == LEVEL_NAME then
stop_background_music(get_current_background_music())
audio_stream_set_looping(rand.randint(audio), true)
audio_stream_play(audio, true, 1)
else
audio_stream_play(audio, true, 0)
end
end

hook_event(HOOK_ON_WARP, on_warp)

at least, this is what worked for me when i was making mine, however the audio is going to play without stopping (ie. if you get a metal cap, the music keeps playing), i haven't found a fix of it as of far, but that's not a terrible downside in my opinion.
 
ye i just made multiple
if gNetworkPlayers[0].currLevelNum == LEVEL_NAME then
stop_background_music(get_current_background_music())
audio_stream_set_looping(rand.randint(audio), true)
audio_stream_play(audio, true, 1) inside the onwarp function

with that i made a custom music mod where some of the songs are classical music
 

Users who are viewing this thread