Lumino (C API)
音声機能

音声機能 More...

Functions

LNResult LNGameAudio_PlayBGM (const LNChar *filePath, float volume, float pitch, double fadeTime)
 ゲーム向け音声再生のユーティリティクラスです。 More...
 
LNResult LNGameAudio_PlayBGMMem (const void *data, int dataSize, float volume, float pitch, double fadeTime)
 メモリ上の音声ファイルデータを使用して BGM を演奏します。 More...
 
LNResult LNGameAudio_StopBGM (double fadeTime)
 BGM の演奏を停止します。 More...
 
LNResult LNGameAudio_PlayBGS (const LNChar *filePath, float volume, float pitch, double fadeTime)
 BGS を演奏します。 More...
 
LNResult LNGameAudio_PlayBGSMem (const void *data, int dataSize, float volume, float pitch, double fadeTime)
 メモリ上の音声ファイルデータから BGS を演奏します。 More...
 
LNResult LNGameAudio_StopBGS (double fadeTime)
 BGS の演奏を停止します。、 More...
 
LNResult LNGameAudio_PlayME (const LNChar *filePath, float volume, float pitch)
 ME を演奏します。 More...
 
LNResult LNGameAudio_PlayMEMem (const void *data, int dataSize, float volume, float pitch)
 メモリ上の音声ファイルデータから ME を演奏します。 More...
 
LNResult LNGameAudio_StopME ()
 ME の演奏を停止します。
 
LNResult LNGameAudio_PlaySE (const LNChar *filePath, float volume, float pitch)
 SE を演奏します。 More...
 
LNResult LNGameAudio_PlaySE3D (const LNChar *filePath, const LNVector3 *position, float distance, float volume, float pitch)
 SE を演奏します。(3D サウンド) More...
 
LNResult LNGameAudio_PlaySE3DXYZ (const LNChar *filePath, float x, float y, float z, float distance, float volume, float pitch)
 SE を演奏します。(3D サウンド) More...
 
LNResult LNGameAudio_PlaySEMem (const void *data, int dataSize, float volume, float pitch)
 メモリ上の音声データから SE を演奏します。 More...
 
LNResult LNGameAudio_PlaySE3DMem (const void *data, int dataSize, const LNVector3 *position, float distance, float volume, float pitch)
 メモリ上の音声ファイルデータから SE を演奏します。 (3D サウンド) More...
 
LNResult LNGameAudio_PlaySE3DMemXYZ (const void *data, int dataSize, float x, float y, float z, float distance, float volume, float pitch)
 メモリ上の音声ファイルデータから SE を演奏します。(3D サウンド) More...
 
LNResult LNGameAudio_StopSE ()
 すべての SE の演奏を停止します。
 
LNResult LNGameAudio_SetBGMVolume (float volume, double fadeTime)
 再生中のBGMの音量を設定します。(フェードアウト中は無効) More...
 
LNResult LNGameAudio_SetBGSVolume (float volume, double fadeTime)
 再生中のBGSの音量を設定します。(フェードアウト中は無効) More...
 
LNResult LNSoundListener_SetPosition (const LNVector3 *position)
 3D音声のリスナーに関する情報を操作します。 More...
 
LNResult LNSoundListener_SetPositionXYZ (float x, float y, float z)
 3D音声のリスナーの位置を設定します。 More...
 
LNResult LNSoundListener_SetDirection (const LNVector3 *direction)
 3D音声のリスナーの正面方向を設定します。 More...
 
LNResult LNSoundListener_SetDirectionXYZ (float x, float y, float z)
 3D音声のリスナーの正面方向を設定します。 More...
 
LNResult LNSoundListener_SetUpDirection (const LNVector3 *direction)
 3D音声のリスナーの上方向を設定します。(正面方向とは直交であること) More...
 
LNResult LNSoundListener_SetUpDirectionXYZ (float x, float y, float z)
 3D音声のリスナーの上方向を設定します。(正面方向とは直交であること) More...
 
LNResult LNSoundListener_SetVelocity (const LNVector3 *velocity)
 3D音声のリスナーの速度を設定します。 More...
 
LNResult LNSoundListener_SetVelocityXYZ (float x, float y, float z)
 3D音声のリスナーの速度を設定します。 More...
 
void LNSound_SetBindingTypeInfo (void *data)
 音声データひとつ分を表し、再生などの操作を行うクラスです。
 
LNResult LNSound_Create (const LNChar *filePath, LNHandle *sound)
 ファイルからサウンドオブジェクトを作成します。 More...
 
LNResult LNSound_CreateMem (const void *data, int dataSize, LNHandle *sound)
 メモリ上の音声ファイルデータからサウンドオブジェクトを作成します。 More...
 
LNResult LNSound_SetVolume (LNHandle sound, float volume)
 サウンドのボリュームを設定します。 More...
 
LNResult LNSound_GetVolume (LNHandle sound, float *outVolume)
 サウンドのボリュームを取得します。 More...
 
LNResult LNSound_SetPitch (LNHandle sound, float pitch)
 サウンドのピッチを設定します。 More...
 
LNResult LNSound_GetPitch (LNHandle sound, float *outPitch)
 サウンドのピッチを取得します。 More...
 
LNResult LNSound_SetLoopEnabled (LNHandle sound, LNBool loopEnable)
 サウンドのループ再生の有無を設定します。 More...
 
LNResult LNSound_IsLoopEnabled (LNHandle sound, LNBool *outEnabled)
 サウンドのループ再生が有効であるかを確認します。 More...
 
LNResult LNSound_SetLoopRange (LNHandle sound, int begin, int length)
 サウンドのループ再生の範囲を設定します。 More...
 
LNResult LNSound_Set3DEnabled (LNHandle sound, LNBool enabled)
 サウンドを 3D 音源であるかを設定します。 More...
 
LNResult LNSound_Is3DEnabled (LNHandle sound, LNBool *outEnabled)
 サウンドが 3D 音源であるかを確認します。 More...
 
LNResult LNSound_SetPlayingMode (LNHandle sound, LNSoundPlayingMode mode)
 サウンド再生時の音声データの再生方法を設定します。 More...
 
LNResult LNSound_GetPlayingMode (LNHandle sound, LNSoundPlayingMode *outMode)
 サウンド再生時の音声データの再生方法を取得します。 More...
 
LNResult LNSound_GetPlayingState (LNHandle sound, LNSoundPlayingState *outState)
 サウンドの再生状態を取得します。 More...
 
LNResult LNSound_Play (LNHandle sound)
 サウンドを再生します。 More...
 
LNResult LNSound_Stop (LNHandle sound)
 サウンドの再生を停止します。 More...
 
LNResult LNSound_Pause (LNHandle sound)
 サウンドの再生を一時停止します。 More...
 
LNResult LNSound_Resume (LNHandle sound)
 サウンドの再生を一時停止します。 More...
 
LNResult LNSound_FadeVolume (LNHandle sound, float targetVolume, double time, LNSoundFadeBehavior behavior)
 サウンド音量のフェード操作を行います。 More...
 
LNResult LNSound_GetPlayedSamples (LNHandle sound, int64_t *outSamples)
 サウンドの再生したサンプル数を取得します。 More...
 
LNResult LNSound_GetTotalSamples (LNHandle sound, int64_t *outSamples)
 サウンドの音声データ全体のサンプル数を取得します。 More...
 
LNResult LNSound_GetSamplingRate (LNHandle sound, int32_t *outRate)
 サウンドのサンプリングレートを取得します。 More...
 
LNResult LNSound_SetEmitterPosition (LNHandle sound, const LNVector3 *position)
 サウンドの 3D 音源としての位置を設定します。 More...
 
LNResult LNSound_SetEmitterPositionXYZ (LNHandle sound, float x, float y, float z)
 サウンドの 3D 音源としての位置を設定します。 More...
 
LNResult LNSound_SetEmitterVelocity (LNHandle sound, const LNVector3 *velocity)
 サウンドの 3D 音源としての速度を設定します。 More...
 
LNResult LNSound_SetEmitterVelocityXYZ (LNHandle sound, float x, float y, float z)
 サウンドの 3D 音源としての速度を設定します。 More...
 
LNResult LNSound_SetEmitterMaxDistance (LNHandle sound, float distance)
 サウンドの 3D 音源の減衰距離 (聴こえなくなる距離) を設定します。(default:100) More...
 

Detailed Description

音声機能

Function Documentation

LNResult LNGameAudio_PlayBGM ( const LNChar *  filePath,
float  volume,
float  pitch,
double  fadeTime 
)

ゲーム向け音声再生のユーティリティクラスです。

BGM を演奏します。

Parameters
[in]filePath: ファイルパス
[in]volume: ボリューム (0.0~1.0)
[in]pitch: ピッチ (0.5~2.0)
[in]fadeTime: フェードインにかける時間 (秒)

BGM はひとつだけ演奏することができ、ループ再生します。 新しい BGM を演奏ようとした場合、再生中の BGM は停止します。 フェードイン時間を指定した場合はクロスフェードしながら音声を切り替えます。

LNResult LNGameAudio_PlayBGMMem ( const void *  data,
int  dataSize,
float  volume,
float  pitch,
double  fadeTime 
)

メモリ上の音声ファイルデータを使用して BGM を演奏します。

Parameters
[in]data: メモリ上の音声ファイルデータ
[in]dataSize: データサイズ (バイト単位)
[in]volume: ボリューム (0.0~1.0)
[in]pitch: ピッチ (0.5~2.0)
[in]fadeTime: フェードインにかける時間 (秒)
LNResult LNGameAudio_PlayBGS ( const LNChar *  filePath,
float  volume,
float  pitch,
double  fadeTime 
)

BGS を演奏します。

Parameters
[in]filePath: ファイルパス
[in]volume: ボリューム (0.0~1.0)
[in]pitch: ピッチ (0.5~2.0)
[in]fadeTime: フェードインにかける時間 (秒)

BGS は風や滝の音などの環境音です。 BGM と同様、ひとつだけ演奏することができ、ループ再生します。

LNResult LNGameAudio_PlayBGSMem ( const void *  data,
int  dataSize,
float  volume,
float  pitch,
double  fadeTime 
)

メモリ上の音声ファイルデータから BGS を演奏します。

Parameters
[in]data: メモリ上の音声ファイルデータ
[in]dataSize: データサイズ (バイト単位)
[in]volume: ボリューム (0.0~1.0)
[in]pitch: ピッチ (0.5~2.0)
[in]fadeTime: フェードインにかける時間 (秒)
LNResult LNGameAudio_PlayME ( const LNChar *  filePath,
float  volume,
float  pitch 
)

ME を演奏します。

Parameters
[in]filePath: ファイルパス
[in]volume: ボリューム (0.0~1.0)
[in]pitch: ピッチ (0.5~2.0)

ME は レベルアップやアイテム取得時のファンファーレ等の効果音楽です。 ME はひとつだけ演奏することができ、ループ再生せずに一度だけ演奏されます。 BGM が再生中であれば一時停止し、ME 終了後に再開させます。

LNResult LNGameAudio_PlayMEMem ( const void *  data,
int  dataSize,
float  volume,
float  pitch 
)

メモリ上の音声ファイルデータから ME を演奏します。

Parameters
[in]data: メモリ上の音声ファイルデータ
[in]dataSize: データサイズ (バイト単位)
[in]volume: ボリューム (0.0~1.0)
[in]pitch: ピッチ (0.5~2.0)
LNResult LNGameAudio_PlaySE ( const LNChar *  filePath,
float  volume,
float  pitch 
)

SE を演奏します。

Parameters
[in]filePath: ファイルパス
[in]volume: ボリューム (0.0~1.0)
[in]pitch: ピッチ (0.5~2.0)

SE はゲーム中の効果音です。 SE は同時に複数再生することができ、同じ音声を演奏した場合は 重ねがけされて演奏されます。

LNResult LNGameAudio_PlaySE3D ( const LNChar *  filePath,
const LNVector3 position,
float  distance,
float  volume,
float  pitch 
)

SE を演奏します。(3D サウンド)

Parameters
[in]filePath: ファイルパス
[in]position: 3D 空間上の座標
[in]distance: 減衰距離
[in]volume: ボリューム (0.0~1.0)
[in]pitch: ピッチ (0.5~2.0)
LNResult LNGameAudio_PlaySE3DMem ( const void *  data,
int  dataSize,
const LNVector3 position,
float  distance,
float  volume,
float  pitch 
)

メモリ上の音声ファイルデータから SE を演奏します。 (3D サウンド)

Parameters
[in]data: メモリ上の音声ファイルデータ
[in]dataSize: データサイズ (バイト単位)
[in]position: 3D 空間上の座標
[in]distance: 減衰距離
[in]volume: ボリューム (0.0~1.0)
[in]pitch: ピッチ (0.5~2.0)
LNResult LNGameAudio_PlaySE3DMemXYZ ( const void *  data,
int  dataSize,
float  x,
float  y,
float  z,
float  distance,
float  volume,
float  pitch 
)

メモリ上の音声ファイルデータから SE を演奏します。(3D サウンド)

Parameters
[in]data: メモリ上の音声ファイルデータ
[in]dataSize: データサイズ (バイト単位)
[in]x: 3D 空間上の X 座標
[in]y: 3D 空間上の Y 座標
[in]z: 3D 空間上の Z 座標
[in]distance: 減衰距離
[in]volume: ボリューム (0.0~1.0)
[in]pitch: ピッチ (0.5~2.0)
LNResult LNGameAudio_PlaySE3DXYZ ( const LNChar *  filePath,
float  x,
float  y,
float  z,
float  distance,
float  volume,
float  pitch 
)

SE を演奏します。(3D サウンド)

Parameters
[in]filePath: ファイルパス
[in]x: 3D 空間上の X 座標
[in]y: 3D 空間上の Y 座標
[in]z: 3D 空間上の Z 座標
[in]distance: 減衰距離
[in]volume: ボリューム (0.0~1.0)
[in]pitch: ピッチ (0.5~2.0)
LNResult LNGameAudio_PlaySEMem ( const void *  data,
int  dataSize,
float  volume,
float  pitch 
)

メモリ上の音声データから SE を演奏します。

Parameters
[in]data: メモリ上の音声ファイルデータ
[in]dataSize: データサイズ (バイト単位)
[in]volume: ボリューム (0.0~1.0)
[in]pitch: ピッチ (0.5~2.0)
LNResult LNGameAudio_SetBGMVolume ( float  volume,
double  fadeTime 
)

再生中のBGMの音量を設定します。(フェードアウト中は無効)

Parameters
[in]volume: ボリューム (0.0~1.0)
[in]fadeTime: フェードアウトにかける時間 (秒)
LNResult LNGameAudio_SetBGSVolume ( float  volume,
double  fadeTime 
)

再生中のBGSの音量を設定します。(フェードアウト中は無効)

Parameters
[in]volume: ボリューム (0.0~1.0)
[in]fadeTime: フェードアウトにかける時間 (秒)
LNResult LNGameAudio_StopBGM ( double  fadeTime)

BGM の演奏を停止します。

Parameters
[in]fadeTime: フェードアウトにかける時間 (秒)
LNResult LNGameAudio_StopBGS ( double  fadeTime)

BGS の演奏を停止します。、

Parameters
[in]fadeTime: フェードアウトにかける時間 (秒)
LNResult LNSound_Create ( const LNChar *  filePath,
LNHandle *  sound 
)

ファイルからサウンドオブジェクトを作成します。

Parameters
[in]filePath: 音声ファイルのパス
[out]sound: 作成されたサウンドオブジェクトのハンドルを格納する変数のポインタ
LNResult LNSound_CreateMem ( const void *  data,
int  dataSize,
LNHandle *  sound 
)

メモリ上の音声ファイルデータからサウンドオブジェクトを作成します。

Parameters
[in]data: メモリ上の音声データへのポインタ
[in]dataSize: データサイズ (バイト単位)
[out]sound: 作成されたサウンドオブジェクトのハンドルを格納する変数のポインタ
LNResult LNSound_FadeVolume ( LNHandle  sound,
float  targetVolume,
double  time,
LNSoundFadeBehavior  behavior 
)

サウンド音量のフェード操作を行います。

Parameters
[in]sound: サウンドハンドル
[in]targetVolume: 変更先の音量
[in]time: フェードにかける時間 (秒)
[in]behavior: フェード完了後の動作の指定
LNResult LNSound_GetPitch ( LNHandle  sound,
float *  outPitch 
)

サウンドのピッチを取得します。

Parameters
[in]sound: サウンドハンドル
[out]outPitch: ピッチを格納する変数
LNResult LNSound_GetPlayedSamples ( LNHandle  sound,
int64_t *  outSamples 
)

サウンドの再生したサンプル数を取得します。

Parameters
[in]sound: サウンドハンドル
[out]outSamples: 再生したサンプル数を格納する変数
LNResult LNSound_GetPlayingMode ( LNHandle  sound,
LNSoundPlayingMode outMode 
)

サウンド再生時の音声データの再生方法を取得します。

Parameters
[in]sound: サウンドハンドル
[out]outMode: 再生方法を格納する変数のポインタ
LNResult LNSound_GetPlayingState ( LNHandle  sound,
LNSoundPlayingState outState 
)

サウンドの再生状態を取得します。

Parameters
[in]sound: サウンドハンドル
[out]outState: 状態を格納する変数
LNResult LNSound_GetSamplingRate ( LNHandle  sound,
int32_t *  outRate 
)

サウンドのサンプリングレートを取得します。

Parameters
[in]sound: サウンドハンドル
[out]outRate: サンプリングレートを格納する変数
LNResult LNSound_GetTotalSamples ( LNHandle  sound,
int64_t *  outSamples 
)

サウンドの音声データ全体のサンプル数を取得します。

Parameters
[in]sound: サウンドハンドル
[out]outSamples: 音声データ全体のサンプル数を格納する変数
LNResult LNSound_GetVolume ( LNHandle  sound,
float *  outVolume 
)

サウンドのボリュームを取得します。

Parameters
[in]sound: サウンドハンドル
[out]outVolume: ボリュームを格納する変数
LNResult LNSound_Is3DEnabled ( LNHandle  sound,
LNBool outEnabled 
)

サウンドが 3D 音源であるかを確認します。

Parameters
[in]sound: サウンドハンドル
[out]outEnabled: 状態を格納する変数のポインタ (LN_TRUE = 3D音声 / LN_FALSE = 非 3D)
LNResult LNSound_IsLoopEnabled ( LNHandle  sound,
LNBool outEnabled 
)

サウンドのループ再生が有効であるかを確認します。

Parameters
[in]sound: サウンドハンドル
[out]outEnabled: ループ再生の有無状態を格納する変数
LNResult LNSound_Pause ( LNHandle  sound)

サウンドの再生を一時停止します。

Parameters
[in]sound: サウンドハンドル
LNResult LNSound_Play ( LNHandle  sound)

サウンドを再生します。

Parameters
[in]sound: サウンドハンドル
LNResult LNSound_Resume ( LNHandle  sound)

サウンドの再生を一時停止します。

Parameters
[in]sound: サウンドハンドル
LNResult LNSound_Set3DEnabled ( LNHandle  sound,
LNBool  enabled 
)

サウンドを 3D 音源であるかを設定します。

Parameters
[in]sound: サウンドハンドル
[in]enabled: LN_TRUE = 3D音声 / LN_FALSE = 非3D
LNResult LNSound_SetEmitterMaxDistance ( LNHandle  sound,
float  distance 
)

サウンドの 3D 音源の減衰距離 (聴こえなくなる距離) を設定します。(default:100)

Parameters
[in]sound: サウンドハンドル
[in]distance: 距離
LNResult LNSound_SetEmitterPosition ( LNHandle  sound,
const LNVector3 position 
)

サウンドの 3D 音源としての位置を設定します。

Parameters
[in]sound: サウンドハンドル
[in]position: 3D 空間上の座標
LNResult LNSound_SetEmitterPositionXYZ ( LNHandle  sound,
float  x,
float  y,
float  z 
)

サウンドの 3D 音源としての位置を設定します。

Parameters
[in]sound: サウンドハンドル
[in]x: 3D 空間上の X 座標
[in]y: 3D 空間上の Y 座標
[in]z: 3D 空間上の Z 座標
LNResult LNSound_SetEmitterVelocity ( LNHandle  sound,
const LNVector3 velocity 
)

サウンドの 3D 音源としての速度を設定します。

Parameters
[in]sound: サウンドハンドル
[in]velocity: 速度
LNResult LNSound_SetEmitterVelocityXYZ ( LNHandle  sound,
float  x,
float  y,
float  z 
)

サウンドの 3D 音源としての速度を設定します。

Parameters
[in]sound: サウンドハンドル
[in]x: 速度の X 成分
[in]y: 速度の Y 成分
[in]z: 速度の Z 成分
LNResult LNSound_SetLoopEnabled ( LNHandle  sound,
LNBool  loopEnable 
)

サウンドのループ再生の有無を設定します。

Parameters
[in]sound: サウンドハンドル
[in]loopEnable: LN_TRUE = ループ再生する / LN_FALSE = しない
LNResult LNSound_SetLoopRange ( LNHandle  sound,
int  begin,
int  length 
)

サウンドのループ再生の範囲を設定します。

Parameters
[in]sound: サウンドハンドル
[in]begin: ループ領域の先頭位置 (サンプル数単位)
[in]length: ループ領域長さ (サンプル数単位)

begin と length に 0 を指定すると、全体をループ領域として設定します。

LNResult LNSound_SetPitch ( LNHandle  sound,
float  pitch 
)

サウンドのピッチを設定します。

Parameters
[in]sound: サウンドハンドル
[in]pitch: ピッチ (0.5~2.0)
LNResult LNSound_SetPlayingMode ( LNHandle  sound,
LNSoundPlayingMode  mode 
)

サウンド再生時の音声データの再生方法を設定します。

Parameters
[in]sound: サウンドハンドル
[in]mode: 読み込み方法
LNResult LNSound_SetVolume ( LNHandle  sound,
float  volume 
)

サウンドのボリュームを設定します。

Parameters
[in]sound: サウンドハンドル
[in]volume: ボリューム (0.0~1.0)
LNResult LNSound_Stop ( LNHandle  sound)

サウンドの再生を停止します。

Parameters
[in]sound: サウンドハンドル
LNResult LNSoundListener_SetDirection ( const LNVector3 direction)

3D音声のリスナーの正面方向を設定します。

Parameters
[in]direction: 向き
LNResult LNSoundListener_SetDirectionXYZ ( float  x,
float  y,
float  z 
)

3D音声のリスナーの正面方向を設定します。

Parameters
[in]x: 向きの X 成分
[in]y: 向きの Y 成分
[in]z: 向きの Z 成分
LNResult LNSoundListener_SetPosition ( const LNVector3 position)

3D音声のリスナーに関する情報を操作します。

3D音声のリスナーの位置を設定します。

Parameters
[in]position: 3D 空間上の座標
LNResult LNSoundListener_SetPositionXYZ ( float  x,
float  y,
float  z 
)

3D音声のリスナーの位置を設定します。

Parameters
[in]x: 3D 空間上の X 座標
[in]y: 3D 空間上の Y 座標
[in]z: 3D 空間上の Z 座標
LNResult LNSoundListener_SetUpDirection ( const LNVector3 direction)

3D音声のリスナーの上方向を設定します。(正面方向とは直交であること)

Parameters
[in]direction: 上方向
LNResult LNSoundListener_SetUpDirectionXYZ ( float  x,
float  y,
float  z 
)

3D音声のリスナーの上方向を設定します。(正面方向とは直交であること)

Parameters
[in]x: 向きの X 成分
[in]y: 向きの Y 成分
[in]z: 向きの Z 成分
LNResult LNSoundListener_SetVelocity ( const LNVector3 velocity)

3D音声のリスナーの速度を設定します。

Parameters
[in]velocity: 速度
LNResult LNSoundListener_SetVelocityXYZ ( float  x,
float  y,
float  z 
)

3D音声のリスナーの速度を設定します。

Parameters
[in]x: 速度の X 成分
[in]y: 速度の Y 成分
[in]z: 速度の Z 成分