BRL.AudioSample: | Functions | Types | Modinfo | Source |
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.
format should be one of:
|
Function LoadAudioSample:TAudioSample( url:Object ) | |
Returns | An audio sample object. |
Description | Load an audio sample. |
Type TAudioSample | |
Description | Audio sample type. |
Field format | |
Description | Sample format. |
Field hertz | |
Description | Sample rate. |
Field length | |
Description | Length, in samples, of the sample data. |
Field samples:Byte Ptr | |
Description | Byte pointer to sample data. |
Method Convert:TAudioSample( to_format ) | |
Returns | A new audio sample object in the specified format. |
Description | Convert audio sample. |
Method Copy:TAudioSample() | |
Returns | A new audio sample object. |
Description | Copy audio sample. |
Function Create:TAudioSample( length,hertz,format ) | |
Returns | A new audio sample object. |
Description | Create an audio sample. |
Function CreateStatic:TAudioSample( samples:Byte Ptr,length,hertz,format ) | |
Returns | A new audio sample object that references an existing block of memory. |
Description | Create a static audio sample. |
Type TAudioSampleLoader | |
Description | Audio sample loader type. |
Information | To create your own audio sample loaders, you should extend this type and provide a LoadAudioSample method. To add your audio sample loader to the system, simply create an instance of it using New. |
Method LoadAudioSample:TAudioSample( stream:TStream ) Abstract | |
Returns | A new audio sample object, or Null if sample could not be loaded. |
Description | Load an audio sample. |
Information | Extending types must implement this method. |
Version | 1.04 |
---|---|
Author | Mark Sibly |
License | Blitz Shared Source Code |
Copyright | Blitz Research Ltd |
Modserver | BRL |
History | 1.04 Release |
History | ChannelsPerSample array added |