|
@ -86,13 +86,13 @@ struct Source { |
|
|
Source(Source const &) = delete; |
|
|
Source(Source const &) = delete; |
|
|
Source & operator=(Source const &) = delete; |
|
|
Source & operator=(Source const &) = delete; |
|
|
|
|
|
|
|
|
Source(Buffer const & buffer){ |
|
|
Source(Buffer const & buffer){ |
|
|
int r = rand() % 10; |
|
|
|
|
|
float pitch = 0.5 + r*0.5; |
|
|
|
|
|
|
|
|
|
|
|
alGenSources(1, &source); |
|
|
alGenSources(1, &source); |
|
|
alSourcei(source, AL_BUFFER, buffer.buffer); |
|
|
alSourcei(source, AL_BUFFER, buffer.buffer); |
|
|
alSourcef(source, AL_PITCH, pitch); //?
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void set_pitch(float pitch){ |
|
|
|
|
|
alSourcef(source, AL_PITCH, pitch); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void play(){ |
|
|
void play(){ |
|
|