have a folder structure like this, starfarer/mods/YourfactionID/sounds/fx/guns and place the sound files in here, you cannot change the sound files from their original sound format.
have a config folder in Data with a sounds.json
inside it should look like this.
{
"mplasc.ogg":[{"file":"sounds/nephalem/fx/guns/mplasc.ogg","pitch":1,"volume":1.0}],
"kaefire (3).ogg":[{"file":"sounds/nephalem/fx/guns/kaefire (3).ogg","pitch":1,"volume":1.0}],
"calfire.ogg":[{"file":"sounds/nephalem/fx/guns/calfire.ogg","pitch":1,"volume":1.0}],
"kaefire (1).ogg":[{"file":"sounds/nephalem/fx/guns/kaefire (1).ogg","pitch":1,"volume":1.0}],
"rflfire (1).ogg":[{"file":"sounds/nephalem/fx/guns/rflfire (1).ogg","pitch":1,"volume":0.50}],
"plloop.ogg":[{"file":"sounds/nephalem/fx/guns/plloop.ogg","pitch":1,"volume":2.0}],
"ocdown.ogg":[{"file":"sounds/nephalem/fx/guns/ocdown.ogg","pitch":1,"volume":1.0}],
"hlc (2).ogg":[{"file":"sounds/nephalem/fx/guns/hlc (2).ogg","pitch":1,"volume":1.5}],
"kiofire (2).ogg":[{"file":"sounds/nephalem/fx/guns/kiofire (2).ogg","pitch":1,"volume":1.0}],
}
and chose the weapon sound from one you have in the sound.json, my own weapon as an example.
{
"specClass":"beam",
"id":"particle_cannon",
"type":"ENERGY",
"size":"LARGE",
"displayArcRadius":1250,
"turretSprite":"graphics/weapons/particle_cannon_turret_base.png",
"turretGlowSprite":"graphics/weapons/particle_cannon_turret_glow.png",
"hardpointSprite":"graphics/weapons/particle_cannon_turret_base.png",
"hardpointGlowSprite":"graphics/weapons/particle_cannon_turret_glow.png",
"turretOffsets":[18, 0],
"turretAngleOffsets":[0],
"hardpointOffsets":[18, 0],
"hardpointAngleOffsets":[0],
"fringeColor":[255,0,255,255],
"coreColor":[255,255,255,255],
"glowColor":[255,0,255,255],
"darkCore":false,
"width":20.0,
"textureType":ROUGH,
#"textureType":["graphics/fx/emp_arcs.png","graphics/fx/emp_arcs.png"],
"textureScrollSpeed":200.0,
"pixelsPerTexel":5.0,
"pierceSet":[PROJECTILE_FF,PROJECTILE_NO_FF,PROJECTILE_FIGHTER,MISSILE_FF,MISSILE_NO_FF],
#"pierceSet":[PROJECTILE_FF,PROJECTILE_NO_FF,PROJECTILE_FIGHTER,MISSILE_FF,MISSILE_NO_FF,FIGHTER],
#"collisionClass":HITS_SHIPS_AND_ASTEROIDS,
#"collisionClassByFighter":HITS_SHIPS_AND_ASTEROIDS,
"fireSoundOne":"kiofire (2).ogg",
}