voice_set_frequency doesn't work
Frank Drebin

this is how i play my sounds

void play_sound(SAMPLE* smpl, int vol, int prior)
{
   int voice=allocate_voice(smpl);
   if (voice>-1)
   {
      voice_set_volume(voice,vol);
      voice_set_priority(voice,prior);
      //voice_set_frequency(voice,1000);
      voice_start(voice);
      release_voice(voice);
   }
}

everything worked fine until i used voice_set_frequency here to slow down the sample.
it tried a value of 500 first when the sample sounded just like noise.
when i use 1000 here it doesn't sound any better...

Kitty Cat
TFM said:

Sets the pitch of the voice, in Hz.

500 and 1000 are way too low to make any meaningful noise. 8000 is the lowest I've seen things go, and even that's pretty bad.

Frank Drebin

manual says

Quote:

1000 represents the frequency that the sample was recorded at, 2000 is twice this, etc.

Kitty Cat
Frank Drebin

ok so what's the according value for voice_set_frequency ?

James Stanley

I suspect it's the frequency of play. i.e. a byte (or whatever) is sent to the speaker every x Hz

Frank Drebin

i will answer myself: smpl->freq ;)

Thread #588918. Printed from Allegro.cc