Question about custom sound

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
theOmega
Private
Posts: 5
Joined: Thu Oct 16, 2003 1:50 am

Question about custom sound

Post by theOmega »

I followed the tutorial by jv_map using the workaround and it works fine. I was just wondering if it was possible to use a path name that points to a sound file within the map's .pk3 instead of having to put it in the mohaa sound dir.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

wav

Post by tltrude »

Wav file or Mp3? Wav files can be in your pk3 in the sound/whatever folder. But, mp3 music files are not in main, so you can't add them to a pk3. You would have to distribute a sound folder along with your pk3.
Tom Trude,

Image
User avatar
small_sumo
Lieutenant General
Posts: 953
Joined: Mon Jul 01, 2002 4:17 pm
Contact:

Re: wav

Post by small_sumo »

tltrude wrote:Wav file or Mp3? Wav files can be in your pk3 in the sound/whatever folder. But, mp3 music files are not in main, so you can't add them to a pk3. You would have to distribute a sound folder along with your pk3.
Is that right I neevr knew, I had a mp3 of music in my monastery map, it worked well at home here but I must admit I never used it on a server. I might better look into that.

Thanks
Image

www.smallsumo.tk

Yeah Truth above Honor Man ;)
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I think tltrude is right, mp3 sounds need not be in a pk3 file.

Any time remember to use 'loaded' in the alias definition for sounds in a pk3 file, 'streamed' for extracted sounds.
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Opps

Post by tltrude »

Wait, the mp3's are in main/sound/music, so I guess you could put them in your pk3. But, it would sure make the pk3 larger, and most people turn the music off anyway.
Tom Trude,

Image
theOmega
Private
Posts: 5
Joined: Thu Oct 16, 2003 1:50 am

Post by theOmega »

I can get it to work with the mp3 in the main/sound/amb dir with:

Code: Select all

local.master aliascache piano sound/amb/pianoman.mp3 soundparms 1.0 1.0 1.0 0.0 200 500 auto loaded maps "obj dm"
I can get it to work with the wav in the main/sound/amb dir with:

Code: Select all

local.master aliascache piano sound/amb/pianoman.wav soundparms 1.0 1.0 1.0 0.0 200 500 auto streamed maps "obj dm"
but i cannot get it to work at all if i have either sound format in my pk3 sound dir :( .

Not sure what I am doing wrong, but i am sure that i need help :lol: .
theOmega
Private
Posts: 5
Joined: Thu Oct 16, 2003 1:50 am

Post by theOmega »

While i am asking, how do you make it so walls dampen the sound?
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

check what codec the wav file is useing . The sound will need to be in pcm format to use in a pak . You can open the sound with windows sound recorder and then use save as . Then change the codec format to pcm I am not sure what sample rates or bit rates work but you can test them and see . I made a map with PCM 22.050 kHz, 8 Bit, Mono that worked .
theOmega
Private
Posts: 5
Joined: Thu Oct 16, 2003 1:50 am

Post by theOmega »

It seems as though i had to change the wav file to 22.020 kHz for it to work in the pk3. Today, for some reason, i got the mp3 to work also. I did change the sound source from a script_model to a sound_speaker. Not sure if that makes a difference. Thx to all for the help. Still wondering if its possible to have the sound be dampened by walls.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

theOmega wrote:Still wondering if its possible to have the sound be dampened by walls.
It isn't :(
Image
theOmega
Private
Posts: 5
Joined: Thu Oct 16, 2003 1:50 am

Post by theOmega »

Eh its ok. I accomplished what i set out to accomplish for the most part. Thx to all who helped. I really appreciate it.
User avatar
small_sumo
Lieutenant General
Posts: 953
Joined: Mon Jul 01, 2002 4:17 pm
Contact:

Post by small_sumo »

Dl my monastery map and you will see the music comeing from where the guy is eating is a small mp3. Check the code to see how I did it.

:)
Image

www.smallsumo.tk

Yeah Truth above Honor Man ;)
Post Reply