BRL.AudioSample: | Types | Functions | Source |
TAudioSample | Audio sample type |
TAudioSampleLoader | Audio sample loader type |
CreateAudioSample | Create an audio sample |
CreateStaticAudioSample | Create an audio sample with existing data |
LoadAudioSample | Load an audio sample |
Function CreateAudioSample:TAudioSample( length,hertz,format ) | |||||||||||||||
Returns | An audio sample object | ||||||||||||||
Description | Create an audio sample | ||||||||||||||
Information |
length is the number of samples to allocate for the sample. hertz is the frequency in samples per second (hz)
the audio sample will be played. format should be one of:
| ||||||||||||||
Example | ' createaudiosample.bmx Local sample:TAudioSample=CreateAudioSample( 32,11025,SF_MONO8 ) For Local k=0 Until 32 sample.samples[k]=Sin(k*360/32)*127.5+127.5 Next Local sound:TSound=LoadSound( sample,True ) PlaySound(sound) Input |
Function CreateStaticAudioSample:TAudioSample( samples:Byte Ptr,length,hertz,format ) | |
Returns | An audio sample object that references an existing block of memory |
Description | Create an audio sample with existing data |
Information |
The memory referenced by a static audio sample is not released when the audio sample is
deleted.
See CreateAudioSample for possile format values. |
Function LoadAudioSample:TAudioSample( url:Object ) | |
Returns | An audio sample object |
Description | Load an audio sample |