-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ASoundManager::GetPitch() INCORRECT
- Loading branch information
1 parent
f086e01
commit 1fe82ad
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |