Skip to content

Commit

Permalink
Added ASoundManager::GetPitch() INCORRECT
Browse files Browse the repository at this point in the history
  • Loading branch information
AdventureT committed Dec 10, 2023
1 parent f086e01 commit 1fe82ad
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
16 changes: 16 additions & 0 deletions OpenJPOG/Source/ASoundManager.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include "ASoundManager.h"

TOSHI_NAMESPACE_USING

TFLOAT ASoundManager::GetPitch(TINT a_iChannel) const
{
TINT freq;
if (a_iChannel != -1) {
FSOUND_SAMPLE* pSample = FSOUND_GetCurrentSample(a_iChannel);
if (pSample) {
FSOUND_Sample_GetDefaults(pSample, &freq, NULL, NULL, NULL);
return FSOUND_GetFrequency(a_iChannel) / a_iChannel;
}
}
return 0.0f;
}
13 changes: 13 additions & 0 deletions OpenJPOG/Source/ASoundManager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#pragma once
#include "TKernel/TDebug.h"
#include "fmod.h"

TOSHI_NAMESPACE_BEGIN

class ASoundManager
{
public:
TFLOAT GetPitch(TINT a_iChannel) const;
};

TOSHI_NAMESPACE_END

0 comments on commit 1fe82ad

Please sign in to comment.