Class Audio
Inheritance
BaseObject
Audio
Inherited Members
BaseObject.type
BaseObject.valid
BaseObject.id
BaseObject.destroy
BaseObject.getMetaDataKeys
BaseObject.getSyncedMeta
BaseObject.hasSyncedMeta
BaseObject.getSyncedMetaKeys
BaseObject.refCount
Package: @altmp/altv-types
Syntax
class Audio extends BaseObject
Constructors
|
Improve this Doc
View Source
Audio(string, number, boolean, boolean)
Declaration
public Audio(source: string, volume?: number, radio?: boolean, clearCache?: boolean): Audio
Parameters
Type |
Name |
Description |
string |
source |
|
number |
volume |
|
boolean |
radio |
|
boolean |
clearCache |
|
Properties
|
Improve this Doc
View Source
all
Declaration
public readonly static all: readonly Audio[]
Property Value
Type |
Description |
readonly Audio[] |
|
|
Improve this Doc
View Source
count
Declaration
public readonly static count: number
Property Value
|
Improve this Doc
View Source
source
Declaration
Property Value
|
Improve this Doc
View Source
looped
Declaration
Property Value
|
Improve this Doc
View Source
volume
Declaration
Property Value
|
Improve this Doc
View Source
currentTime
Declaration
public readonly currentTime: number
Property Value
|
Improve this Doc
View Source
maxTime
Declaration
public readonly maxTime: number
Property Value
|
Improve this Doc
View Source
playing
Declaration
public readonly playing: boolean
Property Value
Methods
|
Improve this Doc
View Source
getByID(number)
Declaration
public static getByID(id: number): null | Audio
Parameters
Type |
Name |
Description |
number |
id |
|
Returns
Type |
Description |
null | Audio |
|
|
Improve this Doc
View Source
addOutput(AudioOutput)
Declaration
public addOutput(output: AudioOutput): void
Parameters
|
Improve this Doc
View Source
removeOutput(AudioOutput)
Declaration
public removeOutput(output: AudioOutput): void
Parameters
|
Improve this Doc
View Source
getOutputs()
Declaration
public getOutputs(): readonly number | AudioOutput[]
Returns
|
Improve this Doc
View Source
play()
Declaration
|
Improve this Doc
View Source
pause()
Declaration
|
Improve this Doc
View Source
reset()
Declaration
|
Improve this Doc
View Source
seek(number)
Declaration
public seek(time: number): void
Parameters
Type |
Name |
Description |
number |
time |
|
|
Improve this Doc
View Source
on("inited", () => void)
Declaration
public on(event: "inited", callback: () => void): void
Parameters
Type |
Name |
Description |
"inited" |
event |
|
() => void |
callback |
|
|
Improve this Doc
View Source
on("streamStarted", () => void)
Declaration
public on(event: "streamStarted", callback: () => void): void
Parameters
Type |
Name |
Description |
"streamStarted" |
event |
|
() => void |
callback |
|
|
Improve this Doc
View Source
on("streamEnded", () => void)
Declaration
public on(event: "streamEnded", callback: () => void): void
Parameters
Type |
Name |
Description |
"streamEnded" |
event |
|
() => void |
callback |
|
|
Improve this Doc
View Source
on("streamPaused", () => void)
Declaration
public on(event: "streamPaused", callback: () => void): void
Parameters
Type |
Name |
Description |
"streamPaused" |
event |
|
() => void |
callback |
|
|
Improve this Doc
View Source
on("streamReset", () => void)
Declaration
public on(event: "streamReset", callback: () => void): void
Parameters
Type |
Name |
Description |
"streamReset" |
event |
|
() => void |
callback |
|
|
Improve this Doc
View Source
on("streamSeek", (time: number) => void)
Declaration
public on(event: "streamSeek", callback: (time: number) => void): void
Parameters
Type |
Name |
Description |
"streamSeek" |
event |
|
(time: number) => void |
callback |
|
|
Improve this Doc
View Source
on("volumeChange", (vol: number) => void)
Declaration
public on(event: "volumeChange", callback: (vol: number) => void): void
Parameters
Type |
Name |
Description |
"volumeChange" |
event |
|
(vol: number) => void |
callback |
|
|
Improve this Doc
View Source
on("error", (code: number, message: string) => void)
Declaration
public on(event: "error", callback: (code: number, message: string) => void): void
Parameters
Type |
Name |
Description |
"error" |
event |
|
(code: number, message: string) => void |
callback |
|
|
Improve this Doc
View Source
Declaration
public deleteMeta(key: string): void
Parameters
Type |
Name |
Description |
string |
key |
|
|
Improve this Doc
View Source
Declaration
public deleteMeta<K extends never>(key: K): void
Parameters
Type |
Name |
Description |
K |
key |
|
|
Improve this Doc
View Source
Declaration
public hasMeta(key: string): boolean
Parameters
Type |
Name |
Description |
string |
key |
|
Returns
|
Improve this Doc
View Source
Declaration
public hasMeta<K extends never>(key: K): boolean
Parameters
Type |
Name |
Description |
K |
key |
|
Returns
|
Improve this Doc
View Source
Declaration
public getMeta<K extends string>(key: Exclude<K, never>): unknown
Parameters
Type |
Name |
Description |
Exclude<K, never> |
key |
|
Returns
|
Improve this Doc
View Source
Declaration
public getMeta<K extends never>(key: K): undefined | ICustomAudioMeta[K]
Parameters
Type |
Name |
Description |
K |
key |
|
Returns
|
Improve this Doc
View Source
Declaration
public getMeta<V extends unknown>(key: string): undefined | V
Parameters
Type |
Name |
Description |
string |
key |
|
Returns
Type |
Description |
undefined | V |
|
|
Improve this Doc
View Source
Declaration
public setMeta<K extends string>(key: K, value: InterfaceValueByKey<ICustomAudioMeta, K, unknown, void>): void
Parameters
Type |
Name |
Description |
K |
key |
|
InterfaceValueByKey<ICustomAudioMeta, K, unknown, void> |
value |
|
|
Improve this Doc
View Source
Declaration
public setMeta<K extends never>(key: K, value: ICustomAudioMeta[K]): void
Parameters
|
Improve this Doc
View Source
Declaration
public setMeta<V extends unknown, K extends string>(key: K, value: InterfaceValueByKey<ICustomAudioMeta, K, V, void>): void
Parameters
Type |
Name |
Description |
K |
key |
|
InterfaceValueByKey<ICustomAudioMeta, K, V, void> |
value |
|
|
Improve this Doc
View Source
Declaration
public setMeta(values: MetaValues<ICustomAudioMeta>): void
Parameters