![]() |
Lumino
|
#include <Sound.hpp>
Inherits ln::Object.
Public Member Functions | |
void | setVolume (float value) |
Sound クラスのインスタンスを作成します。 More... | |
float | getVolume () const |
この Sound の音量を取得します。 | |
void | setPitch (float value) |
この Sound のピッチ (音高) を設定します。 More... | |
float | getPitch () const |
この Sound のピッチ (音高) を取得します。 | |
void | setLoopEnabled (bool enabled) |
ループ再生の有無を設定します。 More... | |
bool | isLoopEnabled () const |
ループ再生が有効かを確認します。 | |
void | SetLoopRange (uint32_t begin, uint32_t length) |
ループ範囲を設定します。 More... | |
void | play () |
この Sound の再生を開始します。 | |
void | stop () |
この Sound の再生を停止します。 | |
void | pause () |
この Sound の再生を一時停止します。 | |
void | resume () |
一時停止中の再生を再開します。 | |
void | set3DEnabled (bool enabled) |
サウンドを 3D 音源として再生するかを設定します。(規定値:false) More... | |
bool | is3DEnabled () const |
この Sound が 3D 音声であるかを確認します。 | |
void | setEmitterPosition (const Vector3 &position) |
3D 音声としての位置を設定します。 | |
const Vector3 & | getEmitterPosition () const |
3D 音声としての位置を取得します。 | |
void | setEmitterVelocity (const Vector3 &velocity) |
3D 音声としての速度を設定します。 | |
const Vector3 & | getEmitterVelocity () const |
3D 音声としての位置を取得します。 | |
void | setEmitterMaxDistance (float distance) |
3D 音声としての減衰距離を設定します。(default:100) | |
int64_t | getTotalSamples () const |
音声データの全サンプル数を取得します。 More... | |
int64_t | getPlayedSamples () const |
現在の再生サンプル数を取得します。 | |
int | getSamplingRate () const |
サンプリングレートを取得します。 More... | |
SoundPlayingState | playingState () const |
この Sound の現在の再生状態を取得します。 | |
void | fadeVolume (float targetVolume, float time, SoundFadeBehavior behavior) |
音量のフェードを開始します。 More... | |
void ln::Sound::fadeVolume | ( | float | targetVolume, |
float | time, | ||
SoundFadeBehavior | behavior | ||
) |
音量のフェードを開始します。
[in] | targetVolume | : フェード先音量 |
[in] | time | : 変化にかける時間 (秒) |
[in] | state | : 音量フェード完了時の動作 現在の音量から targetVolume へ音量の遷移を行います。現在の音量は getVolume() で取得できる値です。 フェード中は音量が変更され、getVolume() で取得できる値が変わります。 |
int ln::Sound::getSamplingRate | ( | ) | const |
サンプリングレートを取得します。
MIDI の場合は 768 を返します。
int64_t ln::Sound::getTotalSamples | ( | ) | const |
音声データの全サンプル数を取得します。
MIDI の場合はミュージックタイム単位 (四分音符ひとつ分が 768) で、 1度でも play() で再生を開始していないと取得できません。
void ln::Sound::set3DEnabled | ( | bool | enabled | ) |
サウンドを 3D 音源として再生するかを設定します。(規定値:false)
設定は play() の前に行う必要があります。
void ln::Sound::setLoopEnabled | ( | bool | enabled | ) |
ループ再生の有無を設定します。
[in] | enabled | : true の場合、ループ再生する |
void ln::Sound::SetLoopRange | ( | uint32_t | begin, |
uint32_t | length | ||
) |
ループ範囲を設定します。
[in] | begin | : ループ範囲の開始サンプル |
[in] | length | : ループ範囲のサンプル数 |
MIDI の場合、ループ範囲はミュージックタイム単位 (四分音符ひとつ分を 768 で表す) で指定します。
void ln::Sound::setPitch | ( | float | value | ) |
この Sound のピッチ (音高) を設定します。
[in] | volume | : ピッチ (0.5~2.0。初期値は 1.0) |
void ln::Sound::setVolume | ( | float | value | ) |