.ogg sounds volume

User avatar
Dan Duncombe
Member
 
Posts: 904
Joined: Thu May 09, 2013 21:11

.ogg sounds volume

by Dan Duncombe » Wed Jul 24, 2013 15:55

Does anyone here know how to make a node play an .ogg louder than another when both sounds are at the same time?
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.
 

User avatar
Mossmanikin
Member
 
Posts: 599
Joined: Sun May 19, 2013 16:26

by Mossmanikin » Wed Jul 24, 2013 16:05

Do you mean something like:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.sound_play("some_sound_01", {
            pos = self.object:getpos(),
            gain = 0.7,
        })
minetest.sound_play("some_sound_02", {
            pos = self.object:getpos(),
            gain = 0.5,
        })
?
Last edited by Mossmanikin on Wed Jul 24, 2013 16:05, edited 1 time in total.

Noob 4 life!
My stuff
 

User avatar
Dan Duncombe
Member
 
Posts: 904
Joined: Thu May 09, 2013 21:11

by Dan Duncombe » Wed Jul 24, 2013 16:09

Mossmanikin wrote:Do you mean something like:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.sound_play("some_sound_01", {
            pos = self.object:getpos(),
            gain = 0.7,
        })
minetest.sound_play("some_sound_02", {
            pos = self.object:getpos(),
            gain = 0.5,
        })
?


Very similar, my two current (working) bits of code are as follows:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_abm({
    nodenames = {"camo:turret_computer"},
    interval = 2,
    chance = 1,
    action = function(pos, node)
    local objects = minetest.env:get_objects_inside_radius(pos, 20)
        for _,obj in ipairs(objects) do
            if not obj:is_player() then
                music_handle=minetest.sound_play("industrial_siren",
                {pos = pos, gain = 1.0, max_hear_distance = 25,})
            end
        end
    end
})

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_abm({
    nodenames = {"camo:mob_turret"},
    interval = 1,
    chance = 1,
    action = function(pos, node)
    local objects = minetest.env:get_objects_inside_radius(pos, 20)
    if minetest.env:get_node({x=pos.x,y=pos.y-1,z=pos.z}).name ~= 'camo:turret_computer' then return end
        for _,obj in ipairs(objects) do
            if not obj:is_player() then
                local obj_p = obj:getpos()
                local calc = {x=obj_p.x - pos.x,y=obj_p.y+1 - pos.y,z=obj_p.z - pos.z}
                local bullet=minetest.env:add_entity({x=pos.x,y=pos.y,z=pos.z}, "camo:arrow_entity")
                bullet:setvelocity({x=calc.x * ARROW_VELOCITY,y=calc.y * ARROW_VELOCITY,z=calc.z * ARROW_VELOCITY})
                music_handle=minetest.sound_play("gun",
                {pos = pos, gain = 1.0, max_hear_distance = 25,})
            end
        end
    end
})


I want the first ABM to be slightly louder than the second.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.
 

User avatar
Mossmanikin
Member
 
Posts: 599
Joined: Sun May 19, 2013 16:26

by Mossmanikin » Wed Jul 24, 2013 16:21

Have you tested setting one gain value to a lower one? (like "gain = 0.7")
If this doesn't work I'd change one of the ogg sounds with ocenaudio, or whatever program you use to edit sound files.

Noob 4 life!
My stuff
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 16 guests

cron