Class BNKReader
This class is used to scan sound bank (BNK) files. These are containers of many "assets" used to create sounds in response to dynamic game play.
Implements
Namespace: Anki.AudioKinetic
Assembly: Anki.Resources.SDK.dll
Syntax
public class BNKReader : IDisposable
Remarks
The audio bus hierarchy | A sound bank has setups for how the sounds flow from files (and other inputs), thru mixers, and other filters to the output. |
Sound effects | |
Music compositions | These probably are used heavily in Cozmo, but appear unused in Vector |
State transition management | How altering the settings of effects during play. |
Audio events & actions | A map of audio events to the actions to carry out when that event occurs, such as playing a sound, stopping other sounds, changing mixer settings, and so on |
Other sound banks | The set of other sound bank files to load. |
Sounds | WEM sound files, either embedded, or a reference to an external file. |
Examples
You can pipe the sounds into NAudio using code like:
var WEM = soundBank.WEM( .. the id for the sound ..)
var waveOut = new WaveOut();
var waveProvider = WEM.WaveProvider();
waveOut.Init(waveProvider);
waveOut.Play();
Thread.Sleep(30000);
waveOut.Stop();
waveProvider.Dispose();
waveOut.Dispose();
Properties
Events
This is used to enumerate the names and id of events used in the sound bank file. Audio events are sent to "apply actions to the different sound objects or object groups.. The actions you select specify whether the Wwise objects will play, stop, pause, .. mute, set volume, enable effect bypass, and so on.”
Declaration
public IEnumerable<EventInfo> Events { get; }
Property Value
Type | Description |
---|---|
IEnumerable<EventInfo> | A descriptor of the events |
Sounds
This is used to enumerate the names and id of sounds used in the sound bank file
Declaration
public IEnumerable<FileInfo> Sounds { get; }
Property Value
Type | Description |
---|---|
IEnumerable<FileInfo> | A descriptor of the file, including its ids |
Methods
Dispose()
Dispose of any internal resources.
Declaration
public void Dispose()
Dispose(Boolean)
Dispose of the binary stream.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing |
Retain()
Increment the reference count for this object. Decrement the count using Dispose().
Declaration
public BNKReader Retain()
Returns
Type | Description |
---|---|
BNKReader | This object |
WEM(UInt32)
Look up a WEM audio file object for the given file id
Declaration
public WEMReader WEM(uint WEMFileId)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | WEMFileId | The identifier of the WEM file to retrieve |
Returns
Type | Description |
---|---|
WEMReader | null on error, otherwise the object to access the file |
Remarks
The Data Index section is a table of file identifiers and their positions/sizes embedded in the data segment.