Class: Sound

Sound

Sound クラスを使用すると、アプリケーション内のサウンドを処理することができます。
Sound クラスを使用すると、Sound オブジェクトの作成や、外部 MP3 ファイルのオブジェクトへのロードと再生ができます。

The Sound class lets you work with sound in an application.
The Sound class lets you create a Sound object,
load and play an external MP3 file into that object.

new next2d.media.Sound ()

Extends

  • EventDispatcher

Members

next2d.media.Sound.namespace staticconstant

指定されたクラスの空間名を返します。
Returns the space name of the specified class.

Default Value:
  • next2d.media.Sound

bytesLoaded number readonly

既にアプリケーションにロードされているデータのバイト数です。
The number of bytes of data that have been loaded into the application.

Default Value:
  • 0

bytesTotal number readonly

アプリケーションにロードされるファイルの総バイト数。
The total size in bytes of the file being loaded into the application.

Default Value:
  • 0

loopCount number

ループ回数の設定
Loop count setting.

Default Value:
  • 0

namespace constant

指定されたオブジェクトの空間名を返します。
Returns the space name of the specified object.

Default Value:
  • next2d.media.Sound

volume number

ボリュームです。範囲は 0(無音)~ 1(フルボリューム)です。
The volume, ranging from 0 (silent) to 1 (full volume).

Default Value:
  • 1

Methods

next2d.media.Sound.toString ()string static

指定されたクラスのストリングを返します。
Returns the string representation of the specified class.

Default Value:
  • [class Sound]
Returns:
TypeDescription
string

clone ()Sound

Sound クラスを複製します。
Duplicate the Sound class.

Returns:
TypeDescription
Sound

load (request)void

指定した URL から外部 MP3 ファイルのロードを開始します。
Initiates loading of an external MP3 file from the specified URL.

NameTypeDescription
requestURLRequest
Returns:
TypeDescription
void

play (start_time)void

サウンドを再生します。
Play a sound.

NameTypeDefaultDescription
start_timenumber0optional
Returns:
TypeDescription
void

stop ()void

チャンネルで再生しているサウンドを停止します。
Stops the sound playing in the channel.

Returns:
TypeDescription
void

toString ()string

指定されたオブジェクトのストリングを返します。
Returns the string representation of the specified object.

Default Value:
  • [object Sound]
Returns:
TypeDescription
string