AudioContent extends Content
Represents audio content in MCP.
Tags
Table of Contents
Properties
- $annotations : Annotations|null
- $data : string
- $mimeType : string
- $type : string
Methods
- __construct() : mixed
- fromArray() : self
- fromFile() : self
- Create a new AudioContent from a file path.
- fromString() : self
- Create a new AudioContent from a string.
- jsonSerialize() : Annotations}
Properties
$annotations read-only
public
Annotations|null
$annotations
= null
$data read-only
public
string
$data
$mimeType read-only
public
string
$mimeType
$type read-only
public
string
$type
Methods
__construct()
public
__construct(string $data, string $mimeType[, Annotations|null $annotations = null ]) : mixed
Parameters
- $data : string
- $mimeType : string
- $annotations : Annotations|null = null
fromArray()
public
static fromArray(AudioContentData $data) : self
Parameters
- $data : AudioContentData
Return values
selffromFile()
Create a new AudioContent from a file path.
public
static fromFile(string $path[, string|null $mimeType = null ][, Annotations|null $annotations = null ]) : self
Parameters
- $path : string
-
Path to the audio file
- $mimeType : string|null = null
-
Optional MIME type override
- $annotations : Annotations|null = null
-
Optional annotations describing the content
Tags
Return values
selffromString()
Create a new AudioContent from a string.
public
static fromString(string $data, string $mimeType[, Annotations|null $annotations = null ]) : self
Parameters
- $data : string
-
The audio data
- $mimeType : string
-
MIME type of the audio
- $annotations : Annotations|null = null
-
Optional annotations describing the content
Return values
selfjsonSerialize()
public
jsonSerialize() : Annotations}