Hello, I’m trying to play sounds inside a (self-made) audio wave container, but no success as of yet.
When I try to play my sounds via code, nothing happens. The client console does show that AUDIO_WAVEPACK and AUDIO_SOUNDATA are being called, yet no errors or “we could not find x” logs.
Code for running my custom sound:
Citizen.CreateThread(function()
RequestScriptAudioBank("minimal/minimal", false)
while true do
if IsControlJustPressed(1,51) then --e
PlaySoundFrontend(-1, "uniquename01", "minimal_soundset", 1)
print("play")
end
Citizen.Wait(0)
end
end)
Resource manifest:
fx_version 'cerulean'
games { 'gta5' }
files {
"minimal/minimal.awc",
"data/minimal_sounds.dat54.rel"
}
client_scripts {
'test_sounds.lua'
}
data_file 'AUDIO_WAVEPACK' 'minimal'
data_file 'AUDIO_SOUNDDATA' 'data/minimal_sounds.dat'
The complete resource and the source files used to create everything (incl. .oac, .wav, .rel.xml).
minimal.zip (205.9 KB)
Basic workflow is something like:
- Create .oac file to import into OpenIV containing a reference to my .wav file.
- Import to OpenIV using openFormats, extract the .awc in the .rpf.
- Create a .data54.rel.xml file, containing the references the .awc file(s), creating a sound set, creating a container.
- Import data54.rel.xml into CodeWalker, this will convert it into a .data54.rel file.
- Using the manifest, reference the .rel file and .awc to load into FiveM + script files.
Does anyone have some pointers as where I’m going wrong?
Another question, in the data54.rel.xml, the “FileName” in the SimpleSound item should reference the name in the .awc/.oac?