@next2d/media 1.14.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Next2D
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ @next2d/media
2
+ =============
3
+
4
+ ## Installation
5
+
6
+ ```
7
+ npm install @next2d/media
8
+ ```
9
+
10
+ ## License
11
+ This project is licensed under the [MIT License](https://opensource.org/licenses/MIT) - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,206 @@
1
+ import { URLRequest } from "@next2d/net";
2
+ import { EventDispatcher } from "@next2d/events";
3
+ import { DisplayObjectContainer } from "@next2d/display";
4
+ import { SoundTagImpl, SoundCharacterImpl, Character } from "@next2d/interface";
5
+ /**
6
+ * Sound クラスを使用すると、アプリケーション内のサウンドを処理することができます。
7
+ * Sound クラスを使用すると、Sound オブジェクトの作成や、外部 MP3 ファイルのオブジェクトへのロードと再生ができます。
8
+ *
9
+ * The Sound class lets you work with sound in an application.
10
+ * The Sound class lets you create a Sound object,
11
+ * load and play an external MP3 file into that object.
12
+ *
13
+ * @class
14
+ * @memberOf next2d.media
15
+ * @extends EventDispatcher
16
+ */
17
+ export declare class Sound extends EventDispatcher {
18
+ readonly _$sources: AudioBufferSourceNode[];
19
+ private _$bytesLoaded;
20
+ private _$bytesTotal;
21
+ private _$volume;
22
+ private _$currentCount;
23
+ private _$src;
24
+ private _$loopCount;
25
+ private _$stopFlag;
26
+ _$character: Character<SoundCharacterImpl> | null;
27
+ _$audioBuffer: AudioBuffer | null;
28
+ _$arrayBuffer: ArrayBuffer | null;
29
+ /**
30
+ * @constructor
31
+ * @public
32
+ */
33
+ constructor();
34
+ /**
35
+ * @description 指定されたクラスのストリングを返します。
36
+ * Returns the string representation of the specified class.
37
+ *
38
+ * @return {string}
39
+ * @default [class Sound]
40
+ * @method
41
+ * @static
42
+ */
43
+ static toString(): string;
44
+ /**
45
+ * @description 指定されたクラスの空間名を返します。
46
+ * Returns the space name of the specified class.
47
+ *
48
+ * @return {string}
49
+ * @default next2d.media.Sound
50
+ * @const
51
+ * @static
52
+ */
53
+ static get namespace(): string;
54
+ /**
55
+ * @description 指定されたオブジェクトのストリングを返します。
56
+ * Returns the string representation of the specified object.
57
+ *
58
+ * @return {string}
59
+ * @default [object Sound]
60
+ * @method
61
+ * @public
62
+ */
63
+ toString(): string;
64
+ /**
65
+ * @description 指定されたオブジェクトの空間名を返します。
66
+ * Returns the space name of the specified object.
67
+ *
68
+ * @return {string}
69
+ * @default next2d.media.Sound
70
+ * @const
71
+ * @public
72
+ */
73
+ get namespace(): string;
74
+ /**
75
+ * @description 既にアプリケーションにロードされているデータのバイト数です。
76
+ * The number of bytes of data that have been loaded into the application.
77
+ *
78
+ * @member {number}
79
+ * @default 0
80
+ * @readonly
81
+ * @public
82
+ */
83
+ get bytesLoaded(): number;
84
+ /**
85
+ * @description アプリケーションにロードされるファイルの総バイト数。
86
+ * The total size in bytes of the file being loaded into the application.
87
+ *
88
+ * @member {number}
89
+ * @default 0
90
+ * @readonly
91
+ * @public
92
+ */
93
+ get bytesTotal(): number;
94
+ /**
95
+ * @description ループ回数の設定
96
+ * Loop count setting.
97
+ *
98
+ * @member {number}
99
+ * @default 0
100
+ * @public
101
+ */
102
+ get loopCount(): number;
103
+ set loopCount(loop_count: number);
104
+ /**
105
+ * @description 外部サウンドのURL
106
+ * URL for external sound.
107
+ *
108
+ * @member {string}
109
+ * @default ""
110
+ * @public
111
+ */
112
+ get src(): string;
113
+ set src(url: string);
114
+ /**
115
+ * @description ボリュームです。範囲は 0(無音)~ 1(フルボリューム)です。
116
+ * The volume, ranging from 0 (silent) to 1 (full volume).
117
+ *
118
+ * @member {number}
119
+ * @default 1
120
+ * @public
121
+ */
122
+ get volume(): number;
123
+ set volume(volume: number);
124
+ /**
125
+ * @description Sound クラスを複製します。
126
+ * Duplicate the Sound class.
127
+ *
128
+ * @return {Sound}
129
+ * @method
130
+ * @public
131
+ */
132
+ clone(): Sound;
133
+ /**
134
+ * @description 指定した URL から外部 MP3 ファイルのロードを開始します。
135
+ * Initiates loading of an external MP3 file from the specified URL.
136
+ *
137
+ * @param {URLRequest} request
138
+ * @return {void}
139
+ * @method
140
+ * @public
141
+ */
142
+ load(request: URLRequest): void;
143
+ /**
144
+ * @param {ProgressEvent} event
145
+ * @return {void}
146
+ * @method
147
+ * @private
148
+ */
149
+ _$loadStart(event: ProgressEvent): void;
150
+ /**
151
+ * @param {ProgressEvent} event
152
+ * @return {void}
153
+ * @method
154
+ * @private
155
+ */
156
+ _$progress(event: ProgressEvent): void;
157
+ /**
158
+ * @param {ProgressEvent} event
159
+ * @return {void}
160
+ * @method
161
+ * @private
162
+ */
163
+ _$loadEnd(event: ProgressEvent): void;
164
+ /**
165
+ * @description サウンドを再生します。
166
+ * Play a sound.
167
+ *
168
+ * @param {number} [start_time=0]
169
+ * @return {void}
170
+ * @method
171
+ * @public
172
+ */
173
+ play(start_time?: number): void;
174
+ /**
175
+ * @description チャンネルで再生しているサウンドを停止します。
176
+ * Stops the sound playing in the channel.
177
+ *
178
+ * @return {void}
179
+ * @method
180
+ * @public
181
+ */
182
+ stop(): void;
183
+ /**
184
+ * @param {object} tag
185
+ * @param {MovieClip} parent
186
+ * @return {void}
187
+ * @method
188
+ * @private
189
+ */
190
+ _$build(tag: SoundTagImpl, parent: DisplayObjectContainer): void;
191
+ /**
192
+ * @param {number} [start_time=0]
193
+ * @param {number} [offset=0]
194
+ * @return {void}
195
+ * @method
196
+ * @private
197
+ */
198
+ _$createBufferSource(start_time?: number, offset?: number): void;
199
+ /**
200
+ * @param {Event} event
201
+ * @return {void}
202
+ * @method
203
+ * @private
204
+ */
205
+ _$endEventHandler(event: Event): void;
206
+ }