Skip to content

Commit

Permalink
FINE
Browse files Browse the repository at this point in the history
  • Loading branch information
JustDoom committed Dec 17, 2024
1 parent 0a37fcd commit 945b3c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sdl/emulator/SdlSpeaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void SdlSpeaker::stop() {

void SdlSpeaker::generateSample() {
for (int i = 0; i < this->sampleCount; ++i) {
this->beepData[i] = static_cast<int16_t>(this->amplitude * std::sin(2.0 * M_PI * this->frequency * i / this->sampleRate));
this->beepData[i] = static_cast<int16_t>(this->amplitude * std::sin(2.0 * std::acos(-1) * this->frequency * i / this->sampleRate));
}
if (SDL_PutAudioStreamData(this->audioStream, this->beepData.data(), this->beepData.size() * sizeof(int16_t)) < 0) {
std::cerr << "Failed to put data into audio stream: " << SDL_GetError() << std::endl;
Expand Down

0 comments on commit 945b3c7

Please sign in to comment.