Summary
Creates a streaming AudioClip with the provided PCM reader and position callback functions.
Please note that this method is not available on WebGL and will fall back to CreateAudioClip instead.
Syntax
public AudioClip CreateAudioClipStream(AudioClip.PCMReaderCallback pcmReaderCallback, AudioClip.PCMSetPositionCallback pcmSetPositionCallback, ChannelCount channelCount = Stereo, int sampleRate = 0, float from = 0, float duration = -Infinity)
Parameters
| Name |
Type |
Description |
| pcmReaderCallback |
AudioClip.PCMReaderCallback |
Callback function to read PCM data. |
| pcmSetPositionCallback |
AudioClip.PCMSetPositionCallback |
Callback function to set PCM data position. |
| channelCount |
ChannelCount |
The number of audio channels (default is Stereo). |
| sampleRate |
int |
The audio sample rate (default is 0, meaning the current output sample rate). |
| from |
float |
The starting position in seconds (default is 0f). |
| duration |
float |
The duration of the audio clip in seconds (default is negative infinity, meaning the full duration). |
Return Value
| Type |
Description |
| AudioClip |
The generated streaming AudioClip. |