This site is a testing version, but all data is shared with the live forum.


Raised This Month: $12 Target: $400
 3% 

emit_sound problem with pitch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SaraAki
Member
Join Date: Nov 2022
Old 05-15-2024 , 14:02   emit_sound problem with pitch
Reply With Quote #1

what I want to achieve is to change sound pitch.But,this code change nothing
emit_sound(id, CHAN_BODY, g_SoundHe[random(sizeof(g_SoundHe))], 0.5, ATTN_IDLE, 0, PITCH_LOW)
i tried with PITCH_LOW,also with PITCH_HIGH and nothing happens.
SaraAki is online now
v120kaaimcfg
Member
Join Date: Apr 2024
Old 05-15-2024 , 16:06   Re: emit_sound problem with pitch
Reply With Quote #2

Quote:
Originally Posted by SaraAki View Post
what I want to achieve is to change sound pitch.But,this code change nothing
emit_sound(id, CHAN_BODY, g_SoundHe[random(sizeof(g_SoundHe))], 0.5, ATTN_IDLE, 0, PITCH_LOW)
i tried with PITCH_LOW,also with PITCH_HIGH and nothing happens.
You can change the pitch value from 0-255. Maybe 5 is too little for the specific sound to be noticeable.
PHP Code:
/**
 * Pitch values
 */
#define PITCH_NORM      100 /* non-pitch shifted */
#define PITCH_LOW       95  /* other values are possible - 0-255, where 255 is very high */
#define PITCH_HIGH      120 

Last edited by v120kaaimcfg; 05-15-2024 at 16:10.
v120kaaimcfg is offline
SaraAki
Member
Join Date: Nov 2022
Old 05-16-2024 , 04:37   Re: emit_sound problem with pitch
Reply With Quote #3

For example:
emit_sound(id, CHAN_BODY, g_SoundHe[random(sizeof(g_SoundHe))], 0.5, ATTN_IDLE, 0, 5)
SaraAki is online now
v120kaaimcfg
Member
Join Date: Apr 2024
Old 05-16-2024 , 06:02   Re: emit_sound problem with pitch
Reply With Quote #4

Quote:
Originally Posted by SaraAki View Post
For example:
emit_sound(id, CHAN_BODY, g_SoundHe[random(sizeof(g_SoundHe))], 0.5, ATTN_IDLE, 0, 5)
Yes.
https://www.amxmodx.org/api/amxmodx/emit_sound
For example:
emit_sound(id, CHAN_BODY, g_SoundHe[random(sizeof(g_SoundHe))], 0.5, ATTN_IDLE, 0, 25)
emit_sound(id, CHAN_BODY, g_SoundHe[random(sizeof(g_SoundHe))], 0.5, ATTN_IDLE, 0, 50)
emit_sound(id, CHAN_BODY, g_SoundHe[random(sizeof(g_SoundHe))], 0.5, ATTN_IDLE, 0, 75)
emit_sound(id, CHAN_BODY, g_SoundHe[random(sizeof(g_SoundHe))], 0.5, ATTN_IDLE, 0, 100)
emit_sound(id, CHAN_BODY, g_SoundHe[random(sizeof(g_SoundHe))], 0.5, ATTN_IDLE, 0, 125)
emit_sound(id, CHAN_BODY, g_SoundHe[random(sizeof(g_SoundHe))], 0.5, ATTN_IDLE, 0, 150)

Last edited by v120kaaimcfg; 05-16-2024 at 06:03.
v120kaaimcfg is offline
SaraAki
Member
Join Date: Nov 2022
Old 05-16-2024 , 07:16   Re: emit_sound problem with pitch
Reply With Quote #5

Nothing changed.Maybe problem is in sound file?
SaraAki is online now
v120kaaimcfg
Member
Join Date: Apr 2024
Old 05-16-2024 , 07:32   Re: emit_sound problem with pitch
Reply With Quote #6

Quote:
Originally Posted by SaraAki View Post
Nothing changed.Maybe problem is in sound file?
Most likely yeah.
https://audio.online-convert.com/convert-to-wav
Bit resolution: 16 Bit
Sampling rate: 22050 Hz
Audio channels: mono

Also try emitting some default sounds and changing their pitch.

Last edited by v120kaaimcfg; 05-16-2024 at 07:33.
v120kaaimcfg is offline
SaraAki
Member
Join Date: Nov 2022
Old 05-17-2024 , 16:10   Re: emit_sound problem with pitch
Reply With Quote #7

Yes,problem was in WAV file. I will try that sound editor.Tnx
SaraAki is online now
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode