HomeForumSourceResearchGuide
Sign in to contribute to source. how it works
Type definition file io.audio.AudioTrack by barry
expand copy to clipboardexpand
/* {"description" : "This interface wraps audio samples for playback on an audio output instance. All audio samples must be encoded in signed 32-bit integers. An AudioTrack is a use-once entity for playback; samples are discarded immediately after they have been played."} */
interface AudioTrack {
	/* {"@description" : "Instantiate a new audio track, with initial samples. If loop is set to true, the sample set is looped until either append() or finish() is called."} */
	AudioTrack(int4 samples[], opt bool loop)
	/* {"@description" : "Set the volume of this track, in the range 0-100. Values higher than 100 are clipped to 100."} */
	void setVolume(int1 volume)
	/* {"@description" : "Append a further set of audio samples, to be played immediately after the prior set of samples has completed playback. If loop is set to true, this sample set is looped until append() or finish() is called."} */
	bool append(int4 samples[], opt bool loop)
	/* {"@description" : "If the most recently added set of samples has been set to loop, this function removes that loop status and will end playback after the end of the current loop of that sample set."} */
	void finish()
	/* {"@description" : "Get the current playback frame index (how many frames in total have been played)."} */
	int getFrameIndex()
}
Revision history
To propose a new revision to this entity, use dana source put -ut your/new/version.dn -n io.audio.AudioTrack -m "reason for update" -u yourUsername
Version 4 by barry
Version 3 by barry
Version 2 by barry
Version 1 (this version) by barry
Notes for this version: Adds core audio output API